import requests
# pip3 install beautifulsoup4 解析html和xml,修改html和xml
from bs4 import BeautifulSoup
res=requests.get('https://www.autohome.com.cn/news/1/#liststart')
# print(res.text)
# 第二个参数,使用什么解析器
#html.parser内置,不需要安装第三方模块
# soup=BeautifulSoup(res.text,'html.parser')
# pip3 install lxml
soup=BeautifulSoup(res
爬取汽车之家新闻
最新推荐文章于 2024-04-14 18:54:03 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)