Loading

requests-html

学习教程 https://cncert.github.io/requests-html-doc-cn/#/?id=%e5%ae%89%e8%a3%85

1.安装

pip install requests-html

2.使用

from requests_html import HTMLSession

session = HTMLSession()

 

# 获取本页面所有的链接并返回一个列表,保留了url在页面中原本的形式(已经自动去掉了html标签)

r = session.get('https://python.org/')

 

# 获取本页面所有的链接并返回一个列表, 自动将url转换为绝对路径形式(已经自动去掉了html标签)

r.html.absolute_links

posted @ 2020-07-02 00:14  Tester-Dolores  阅读(56)  评论(0编辑  收藏  举报