Qiu-Weidong / Qiu-Weidong.github.io

个人博客
0 stars 0 forks source link

beautifulsoup使用 | 邱维东 #93

Open Qiu-Weidong opened 1 year ago

Qiu-Weidong commented 1 year ago

https://qiu-weidong.github.io/2022/12/12/python/beautifulsoup/

导入BeautifulSoup 1from bs4 import BeautifulSoup 构造BeautifulSoup对象 123soup = BeautifulSoup(html_str, 'lxml')# 也可以使用文件soup = BeautifulSoup(open('index.html'), 'lxml) 节点选择器选择元素 直接