gopup
gopup copied to clipboard
TypeError: string indices must be integers
import gopup as gp cookie==。。。 #正确的赋值后 index_df = gp.baidu_search_index(word="罩", start_date='2020-12-01', end_date='2020-12-25', cookie=cookie) print(index_df)
报错
TypeError Traceback (most recent call last)
C:\ProgramData\Anaconda3\lib\site-packages\gopup\index\index_baidu.py in baidu_search_index(word, start_date, end_date, cookie, type) 264 r = requests.get(url=url, params=params, headers=headers) 265 data = r.json()["data"] --> 266 all_data = data["userIndexes"][0][type]["data"] 267 uniqid = data["uniqid"] 268 ptbk = get_ptbk(uniqid, cookie)
TypeError: string indices must be integers
百度指数有调整,我迭代了一个版本,更新 0.2.9.1版本试试
update到最新版本后运行,还是会报错:
File "D:/1/GitHub/gopup/example/test.py", line 12, in