当执行一个python脚本来获取历史tweet时 我大约2到3分钟后。得到以下错误!!!在
我真的不知道这意味着什么
我怎样才能阻止这一切发生
我在我的速率限制挑衅,因为在执行每个抓取循环之前,我检查,它返回为真!!!在
谢谢你的帮助
Traceback (most recent call last):
File "twitter.py", line 13, in <module>
openurl = urllib.urlopen("https://api.twitter.com/1/statuses/user_timeline.json?include_entities=true&contributor_details&include_rts=true&screen_name="+user+"&count=3600")
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib.py", line 84, in urlopen
return opener.open(url)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib.py", line 205, in open
return getattr(self, name)(url)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib.py", line 449, in open_https
return self.http_error(url, fp, errcode, errmsg, headers)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib.py", line 369, in http_error
result = method(url, fp, errcode, errmsg, headers)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib.py", line 691, in http_error_401
errcode, errmsg, headers)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib.py", line 379, in http_error_default
raise IOError, ('http error', errcode, errmsg, headers)
IOError: ('http error', 401, 'Unauthorized', <httplib.HTTPMessage instance at 0x1005ca9e0>)
脚本运行得很好,但2-3分钟后,它总是中断。。。。在
Twitter的api有每小时150个查询的限制 https://dev.twitter.com/docs/rate-limiting 尝试在一个查询中查询多个tweet。 我想你的401回信会给你一个解释 试试这个
相关问题 更多 >
编程相关推荐