问题描述
我在玩twython并请求软件包,发现有些奇怪的东西阻止了我的代码来检索tweet.如果有帮助,我正在防火墙后面工作.
I am playing with the twython and requests packages and found something strange which is blocking my code to retrive the tweets. I am working behind the firewall if it helps.
代码:
from twython import Twython
t = Twython(app_key=consumer_key,app_secret=consumer_secret,oauth_token=access_token,oauth_token_secret=access_secret)
a = t.search(q="@Benton",count=100)
import requests
requests.get("https://github.com/timeline.json",verify=False)
Twython请求出错:
Error from Twython Request:
请求成功
因此,"cacert.pem"对于请求库似乎工作正常,但对于Twython而言却无法正常工作.我假设Twython调用了请求以获取凭据的验证.是否可以在twyhton呼叫中使用"Verify = False"在Twitter中进行搜索.
So it seems that "cacert.pem" is working fine for Request library but not for Twython. I am assuming the Twython calls the requests to get the verification for the credentials. Is it possible to use "Verify=False" in the twyhton call for search in Twitter.
推荐答案
我认为问题出在防火墙而不是Twython.我在阻止Twitter的网络上收到此错误.
I think the problem is with the firewall rather than with Twython. I get this error on networks that have blocked Twitter.
这篇关于Twython GET中的SSL错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!