python--- bs4和requests模块

1.bs4模块 bs4库 是解析、遍历、维护、“标签树“的功能库。通俗一点说就是: bs4库把html源代码重新进行了格式化,从而方便我们对其中的节点、标签、属性等进行操作。 获取标签内容 from bs4 import BeautifulSoup # 构造对象 soup = BeautifulSoup(open('westos.html'), 'html.parser') # 获取标签, 默
相关文章
相关标签/搜索