网站首页
编程语言
数据库
系统相关
其他分享
编程问答
beatifulsoup
2024-07-01
8、爬虫-beatifulsoup-bs4
beatifulsoup的概念:BeautifulSoup就是Python的一个HTML或XML的解析库,可以用它方便地提取页面的数据。 1、安装bs4:pipinstallbs42、使用:frombs4importBeautifulSoup3、创建对象:BeautifulSoup(文本,“html.parser”) #html.parser告诉解析器这是个html文本4、b