首页
注册
登录
V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请
登录
推荐学习书目
›
Learn Python the Hard Way
Python Sites
›
PyPI
- Python Package Index
›
http://diveintopython.org/toc/index.html
›
Pocoo
值得关注的项目
›
PyPy
›
Celery
›
Jinja2
›
Read the Docs
›
gevent
›
pyenv
›
virtualenv
›
Stackless Python
›
Beautiful Soup
›
结巴中文分词
›
Green Unicorn
›
Sentry
›
Shovel
›
Pyflakes
›
pytest
Python 编程
›
pep8 Checker
Styles
›
PEP 8
›
Google Python Style Guide
›
Code Style from The Hitchhiker's Guide
V2EX
›
Python
推荐一个可以替代urllib2的Python库 requests
c
·
2011-11-24 23:21:09 +08:00
· 5497 次点击
这是一个创建于 4680 天前的主题,其中的信息可能已经有所发展或是发生改变。
0.8使用了urllib3,变动比较大,虽然现在还有很多问题,不过用起来非常不错哦。
经常抓网页的可以考虑下,抓取效率有10%的提升。
项目主页:
http://python-requests.org
Github:
https://github.com/kennethreitz/requests
urllib3
urllib2
Requests
4 条回复
•
1970-01-01 08:00:00 +08:00
1
ayanamist
2011-11-25 10:38:33 +08:00
urllib3使用的keep-alive方式可能会被某些网站屏蔽的。当时我就被Twitter的API给屏蔽了,永远返回404……
2
c
OP
2011-11-25 10:44:11 +08:00
在Requests中可以设置keep-alive=False的
3
phus
2011-11-25 12:56:03 +08:00
httplib2
4
c
OP
2011-11-25 13:32:47 +08:00
@
phus
http://docs.python-requests.org/en/latest/community/faq/#why-not-httplib2
关于
·
帮助文档
·
博客
·
API
·
FAQ
·
实用小工具
·
970 人在线
最高记录 6679
·
Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 31ms ·
UTC 22:59
·
PVG 06:59
·
LAX 15:59
·
JFK 18:59
Developed with
CodeLauncher
♥ Do have faith in what you're doing.