Python中的BS4模块

Python中的bs4模块 bs4 模块的 BeautifulSoup 可以用来爬取html页面的内容,配合requests库可以用于简单的爬虫。 1. 获取标签内容 # 1. 获取标签内容 from bs4 import BeautifulSoup # 构造对象 soup = BeautifulSoup(open('villa.html'), 'html.parser') # 获取标签, 默
相关文章
相关标签/搜索