beautifulsoup学习笔记

安装

pip install bs4

构造beautifulsoup对象

soup=beautifulsoup(text)

搜索元素

x=soup.find('div',class_=)
x=soup.find_all('a',href=)

获取标签内文字和html代码

text=soup.text
html=soup.get_attibute('innerHTML')
原文地址:https://www.cnblogs.com/dreagonm/p/14268722.html