[問題] 上網抓取雅虎財經的資料

看板Python作者 (iuz)時間8年前 (2017/12/07 20:40), 8年前編輯推噓1(101)
留言2則, 2人參與, 8年前最新討論串1/1
我按照書上練習,抓取中美晶今年10月1日到12月7日的股票資訊,不知道為什麼出現錯誤訊息。 raise RemoteDataError('Unable to read URL: {0}'.format(url)) RemoteDataError: Unable to read URL: https://query1.finance.yahoo.com/v7/finance/download/5483?period1=1506787200&period2=1512662399&interval=1d&events=history&crumb=PvaymnVJl%5Cu002Ft =====底下是書上練習碼,我只有改股票代號======= import pandas as pd import pandas_datareader.data as web import datetime start = datetime.datetime(2017,10,1) end = datetime.datetime(2017,12,7) df = web.DataReader('5483.tw','yahoo',start,end) writer=pd.ExcelWriter('./file/stock5483.xlsx') df.to_excel(writer,'Sheet1') writer.save() -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 1.164.24.79 ※ 文章網址: https://www.ptt.cc/bbs/Python/M.1512650455.A.C67.html

12/07 21:37, 8年前 , 1F
5483.two
12/07 21:37, 1F
※ 編輯: iuz (1.164.24.79), 12/07/2017 22:57:18

12/07 23:54, 8年前 , 2F
成功了!謝謝!
12/07 23:54, 2F
文章代碼(AID): #1QAJRNnd (Python)