首页 > 解决方案 > 如何使用 BeautifulSoup Python 提取没有任何标签的 HTML 文本

问题描述

所以,这是我试图抓取的 HTML 代码-

<strong>Some Text</strong>
" Other Text I want"
<strong>Some other text</strong>
" Yet another Text I want"

另一个例子 -

<b>I can get:</b> This is what I also want<br />
<b>Another</b> This is another I want<br />

我尝试了 soup.find_all('b') 并得到了这个输出 -

<b>I can get:</b>
<b>Another</b>

但我也想要下一个文本。

标签: pythonhtmlbeautifulsouptags

解决方案


推荐阅读