1
我剛開始使用twython搜索,但在第一個例子:收到異常,當執行Twython
from twython import Twython
t = Twython()
t.search(q='python')
我收到一個例外:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/dist-packages/twython-2.5.2-py2.7.egg/twython/twython.py", line 367, in search
return self.get('https://api.twitter.com/1.1/search/tweets.json', params=kwargs)
File "/usr/local/lib/python2.7/dist-packages/twython-2.5.2-py2.7.egg/twython/twython.py", line 238, in get
return self.request(endpoint, params=params, version=version)
File "/usr/local/lib/python2.7/dist-packages/twython-2.5.2-py2.7.egg/twython/twython.py", line 233, in request
content = self._request(url, method=method, params=params, files=files, api_call=url)
File "/usr/local/lib/python2.7/dist-packages/twython-2.5.2-py2.7.egg/twython/twython.py", line 210, in _request
retry_after=response.headers.get('retry-after'))
twython.twython.TwythonError: 'Bad Request: The request was invalid. An accompanying error message will explain why. This is the status code will be returned during rate limiting. -- An error occurred processing your request.'
不要任何人知道是什麼原因導致這例外?
感謝,
大號
感謝您的回答,您能否提出解決方案,因爲我對這個問題很陌生。 –
使用驗證? – alexvassel
我想我找到了,謝謝。根據這個https://dev.twitter.com/docs/auth。訪問搜索API無需身份驗證,也許他們最近剛剛更改... –