我正在使用Python和BeautifulSoup从html中提取一些文本 . 我有一些HTML格式的文本
<h3><b> Abc </b><b> DEF </b> </h3>
我想删除重复的b标签 . 有快速的方法吗?
对于bs4,这似乎工作得很好
In [4]: soup.h3 Out[4]: <h3><b> Abc </b><b> DEF </b> </h3> In [5]: soup.h3.text Out[5]: u' Abc DEF '
在这里查看文档和包:https://beautiful-soup-4.readthedocs.org/en/latest/ https://pypi.python.org/pypi/beautifulsoup4
1 回答
对于bs4,这似乎工作得很好
在这里查看文档和包:https://beautiful-soup-4.readthedocs.org/en/latest/ https://pypi.python.org/pypi/beautifulsoup4