Comments (3)
好的,谢谢指正。
from explore-python.
Hi,
在Requests库的使用这一章,重定向这一节的例子在python2.7下会报错,猜测是不是因为Https证书问题?
>>> import requests
>>> headers={'User-Agent':'Mozilla/4.0(compatible;MSIE 5.5;Windows NT)'}
>>> r=requests.get('https://toutiao.io/shares/789751/url',headers=headers)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/site-packages/requests/api.py", line 70, in get
return request('get', url, params=params, **kwargs)
File "/usr/local/lib/python2.7/site-packages/requests/api.py", line 56, in request
return session.request(method=method, url=url, **kwargs)
File "/usr/local/lib/python2.7/site-packages/requests/sessions.py", line 488, in request
resp = self.send(prep, **send_kwargs)
File "/usr/local/lib/python2.7/site-packages/requests/sessions.py", line 609, in send
r = adapter.send(request, **kwargs)
File "/usr/local/lib/python2.7/site-packages/requests/adapters.py", line 473, in send
raise ConnectionError(err, request=request)
requests.exceptions.ConnectionError: ('Connection aborted.', error(53, 'Software caused connection abort'))
from explore-python.
Hi, 测了一下,应该是要访问的链接重定向的网站 https 证书的问题,你可以试试访问 https://toutiao.io/k/c32y51 。
from explore-python.
Related Issues (10)
- English support? HOT 8
- 错别字 HOT 1
- [求助]运行结果与教程不相同 HOT 2
- 错别字 HOT 2
- 关于super()函数
- 默认参数应该使用不可变对象——这个知识点列举的问题在python3.10好像已经不出现了,请大佬看看呢
- 我是外行,想了解下 HOT 4
- 请问如何打包的epub格式? HOT 3
- str没有decode这个属性? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from explore-python.