我正在尝试使用python twitter api(https://github.com/bear/python-twitter)从twitter中提取数据。但我所有的电话都是错误的
import twitter
api = twitter.Api()
api = twitter.Api(consumer_key='XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
consumer_secret='XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
access_token_key='XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
access_token_secret='XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
print api.VerifyCredentials()
Traceback (most recent call last):
File "C:\Users\arpit\Downloads\Desktop\mtp twitter\api.py", line 8, in <module>
print api.VerifyCredentials()
File "C:\Python27\lib\site-packages\twitter.py", line 3648, in VerifyCredentials
json = self._FetchUrl(url, no_cache=True)
File "C:\Python27\lib\site-packages\twitter.py", line 3992, in _FetchUrl
response = opener.open(url, encoded_post_data)
File "C:\Python27\lib\urllib2.py", line 400, in open
response = self._open(req, data)
File "C:\Python27\lib\urllib2.py", line 418, in _open
'_open', req)
File "C:\Python27\lib\urllib2.py", line 378, in _call_chain
result = func(*args)
File "C:\Python27\lib\urllib2.py", line 1215, in https_open
return self.do_open(httplib.HTTPSConnection, req)
File "C:\Python27\lib\urllib2.py", line 1177, in do_open
raise URLError(err)
URLError: <urlopen error [Errno 10061] No connection could be made because the target machine actively refused it>
我在代理服务器后面。我怎么还能使用这个API。我也试过twython但面临类似的问题