0
我正嘗試使用下面的命令下載數據。urllib.urlretrieve失敗
import urllib
url = 'http://www.nse-india.com/content/historical/EQUITIES/2002/MAR/cm01MAR2002bhav.csv.zip'
urllib.urlretrieve(url, 'myzip')
What I see in the file generated file my.zip is,
You don't have permission to access "http://www.nse-india.com/content/historical/EQUITIES/2002/MAR/cm01MAR2002bhav.csv.zip" on this server.<P>
Reference #18.7d427b5c.1311889977.25329891
但我可以從網站上下載的文件沒有問題 ,這是什麼原因。
與用戶代理一樣在Mozilla中試過,仍然有同樣的問題,我嘗試使用[link](http://code.activestate.com/recipes/572202-web-browser-emulator/),現在文件被下載,但額外的字節,它有點損壞。 – kanna
嘗試使用該配方中的其他標題,但不要使用代碼。 – agf