擅长:python、mysql、java
<p>如果您是<strong>网页垃圾处理<strong>使用BeautifulSoup获取文本HTML</p>
<pre><code>!pip install beautifulsoup4
from bs4 import BeautifulSoup
html = """
<td width="35%">Amber Storm Scotch Ale 6%
<br/>SIZE/LIFE: 330ml <b>CASE</b>
<br/>UOS: 12
<br/>RRP: £1.59
<br/>POR%: 100.1%
</td>
"""
BeautifulSoup(html).find('td').text.split('\n')[0]
Output: 'Amber Storm Scotch Ale 6% '
</code></pre>