[ Python ] 爬虫类库学习之 bs4
安装:pip install bs4,pip install lxml 文档:https://beautifulsoup.readthedocs.io/zh_CN/v4.4.0/ 对象的实例化 from bs4 import BeautifulSoup 1、将本地的html文档中的数据加载到该对象中 fp = open('./test.html', 'r' , encoding='utf-8' ) soup = BeautifulSoup(fp, 'lxml' ) 2、将互联网上获取的页面源码加载到该对象中 response = requests.get(url, data, heade
用户评论