擅长:python、mysql、java
<p>使用<code>SoupStrainer</code>比原始查找更有效:</p>
<pre><code>html = BeautifulSoup(page, parseOnlyThese=SoupStrainer('table', 't1' ) )
links = html.findAll('a')
</code></pre>
<p>另请参见<a href="http://www.crummy.com/software/BeautifulSoup/documentation.html#Searching%20by%20CSS%20class" rel="nofollow">Search by Class documentation</a>。</p>