Python请求无法访问https站点

时间:2016-01-18 14:35:32

标签: python-2.7 https web-scraping python-requests

我运行此代码:

import requests

loginurl = 'https://auth.cbssports.com/login/index'

try:
    response = requests.get(loginurl)
except requests.exceptions.ConnectionError as e:
    print "Login URL is BAD"

response = requests.get(loginurl)

它始终返回此错误:

requests.exceptions.ConnectionError: HTTPSConnectionPool(host='auth.cbssports.com', port=443): Max retries exceeded with url: /login/index (Caused by <class 'socket.error'>: [Errno 10054] An existing connection was forcibly closed by the remote host)

我可以手动访问此网址。我无法弄清楚为什么Python不能。有办法解决这个问题吗?

0 个答案:

没有答案