bs4 学习笔记
from bs4 import BeautifulSoup
将获取的html代码进行解析
sup = BeautifulSoup(decode_byte(txt), 'lxml')
返回bs4对象
可用函数find,find_all,select 进行解析后的筛选
clear()函数用于清除标签内容
sup = BeautifulSoup(decode_byte(txt), 'lxml') for i in range(len(sup.select("#divRplyFwdMsg"))): sup_del = sup.select("#divRplyFwdMsg")[i] sup_del.clear()
css选择器可以通过网页设置样式去测试 选中

浙公网安备 33010602011771号