HTML Parsing for Humans 项目衍生自requests-html 用法参考expample
相比于requests-html有如下改进:
- async 请求改用httpx
- 浏览器渲染改用playwright
- 元素操作优化,对于元素查找
find()
、xpath()
的返回结果,参照linq增加筛选select()
、where()
pip install requests-html2
from requests_html2 import HTMLSession
with HTMLSession() as session:
response = session.get('https://python.org/')
print(response.html)