擅长:python、mysql、java
<p>您可能正在搜索带有<code>separator=</code>参数的<code>.get_text()</code>方法</p>
<p>例如(<code>html_code</code>包含您问题中的html代码):</p>
<pre><code>from bs4 import BeautifulSoup
soup = BeautifulSoup(html_code, 'html.parser')
print(soup.select_one('tr.table').get_text(strip=True, separator=' '))
</code></pre>
<p>印刷品:</p>
<blockquote>
<p>0403 Buttermilk, curdled milk and cream, yoghurt, kephir and other
fermented or acidified milk and cream, whether or not concentrated
or containing added sugar or other sweetening matter or flavoured
or containing added fruit, nuts or cocoa Manufacture in which: — all
the materials of Chapter 4 used are wholly obtained, — all the fruit
juice (except that of pineapple, lime or grapefruit) of heading 2009
used is originating, and — the value of all the materials of
Chapter 17 used does not exceed 30 % of the ex-works price of the
product</p>
</blockquote>