from bs4 import BeautifulSoup#注意首字母要大写
soup=BeautifulSoup('<p>data</p>','html.parser')#<p>data</p>表示html信息,html.parser为HTML解析器
Beautiful soup库解析器:
image.png
Beautiful soup 类的基本元素:
image.png
html的标准格式
image.png image.png image.png image.png image.png
bs4的prettify方法:用于输出html的输出
网友评论