MOOC_Python网络爬虫与信息提取课程笔记(三)

2019-07-29  本文已影响0人  42c64edf12e9
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的输出

上一篇 下一篇

猜你喜欢

热点阅读