requests 的作者的新项目 requests-html

2018-02-28 12:05:36 +08:00
 yangzhezjgs
https://github.com/kennethreitz/requests-html

This library intends to make parsing HTML (e.g. scraping the web) as simple and intuitive as possible.

When using this library you automatically get:

-Full JavaScript support!
-CSS Selectors (a.k.a jQuery-style, thanks to PyQuery).
-XPath Selectors, for the faint at heart.
-Mocked user-agent (like a real web browser).
-Automatic following of redirects.
-Connection – pooling and cookie persistence.
-The Requests experience you know and love, with magical parsing abilities.

对 requests 做了封装,添加了解析 html 的接口,总代码现在是 399 行,还在更新
11323 次点击
所在节点    Python
44 条回复
cy97cool
2018-02-28 12:13:53 +08:00
mark 先 star 为敬
lhx2008
2018-02-28 12:24:06 +08:00
把 pyquery 和 xpath 弄进来了,还有自动 useragent,是要一统江湖的节奏
co3site
2018-02-28 12:30:45 +08:00
观望中,先 star
Sanko
2018-02-28 12:33:37 +08:00
orz
prolic
2018-02-28 12:34:51 +08:00
star 为敬,beautifulsoup 用着还是不够爽
weiwio
2018-02-28 12:35:31 +08:00
今天看了一下,原来是新项目,很有希望啊
fyyz
2018-02-28 13:03:12 +08:00
吊炸天
tuding
2018-02-28 13:07:33 +08:00
这个作者好腻害,好多牛逼项目
steveway
2018-02-28 13:10:59 +08:00
看作者就 star 系列
lfzyx
2018-02-28 13:13:14 +08:00
可以放弃 bs4 了?
CSM
2018-02-28 13:17:17 +08:00
期待有人封装 aiohttp
sunwei0325
2018-02-28 13:19:50 +08:00
如果下载和解析分开异步进行就好了
angelshq
2018-02-28 13:30:06 +08:00
mark
Zzde
2018-02-28 13:30:37 +08:00
Mark
find456789
2018-02-28 13:33:39 +08:00
不太明白,这个 库 用来替代谁的?
find456789
2018-02-28 13:42:28 +08:00
请问这个库 是 requests+bs4 吗
douglarek
2018-02-28 13:59:00 +08:00
xxx for humans 又来了?没有 xxx 之前莫不是大家都在吃猪食 ?
soulmine
2018-02-28 14:04:26 +08:00
@find456789 大约看了下 大概类似于 requests+bs4+selenium/phantomjs 不过后面两个现在只是封装了一小部分功能 比如通过 css selector 解析或者执行 js 代码这种
soulmine
2018-02-28 14:05:00 +08:00
@sunwei0325 你可以自己异步啊 比如用队列什么的
hugo2lee
2018-02-28 14:12:03 +08:00
Only later versions of Python 3 are supported. 好评

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/433435

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX