Bs4使用过程中常见的问题
- 1.通过pip install bs4将bs4包进行安装 - 2.导入包from bs4 import BeautifulSoup - 3.把页面源代码交给BeautifulSoup进行处理, 生成bs对象 page = BeautifulSoup(resp.text, "html.parser") # 指定html解析器,如果不指定解析器不会报错,但是会爆红 - 4.从bs对象中查找数据 # find(标签, 属性=值) # find_all(标签, 属性=值) - 5..
原创
2022-03-21 11:37:03 ·
1007 阅读 ·
0 评论