擅长:python、mysql、java
<p>要从<code><source></code>中提取两个文本条目,可以使用以下方法:</p>
<pre><code>from bs4 import BeautifulSoup
import requests
html = """<source><x ctype="x-htmltag" equiv-text="&lt;b&gt;" id="html_tag_191"/>Choose your product\
<x ctype="x-htmltag" equiv-text="&lt;/b&gt;" id="html_tag_192"/>From a list: </source>"""
soup = BeautifulSoup(html, 'lxml')
print(list(soup.source.stripped_strings))
</code></pre>
<p>给你:</p>
<pre><code>['Choose your product', 'From a list:']
</code></pre>