擅长:python、mysql、java
<p>来自<a href="https://www.crummy.com/software/BeautifulSoup/bs4/doc/" rel="nofollow noreferrer">BS4 documentation</a>:</p>
<blockquote>
<p>If a tag contains more than one thing, then it’s not clear what .string should refer to, so .string is defined to be None</p>
</blockquote>
<p>我相信你可以用<code>.text</code>来得到你想要的:</p>
<pre><code>title = a.text.strip()
</code></pre>