安装:
Win平台: “以管理员身份运行”cmd 执行
pip install beautifulsoup4
Beautiful Soup 库的理解:
Beautiful Soup 库解析器:
Beautiful Soup 库的基本元素:
基于bs4库的HTML内容遍历方法:
下行遍历:
soup = BeautifulSoup(url,"html.parser")
#遍历儿子节点
for child in soup.body.children:
print(child
安装:
Win平台: “以管理员身份运行”cmd 执行
pip install beautifulsoup4
Beautiful Soup 库的理解:
Beautiful Soup 库解析器:
Beautiful Soup 库的基本元素:
基于bs4库的HTML内容遍历方法:
下行遍历:
soup = BeautifulSoup(url,"html.parser")
#遍历儿子节点
for child in soup.body.children:
print(child