擅长:python、mysql、java
<p>您可以使用此示例代码。你知道吗</p>
<pre><code>import urllib
from BeautifulSoup import *
url = raw_input('Enter - ')
html = urllib.urlopen(url).read()
soup = BeautifulSoup(html)
# Retrieve all of the anchor tags
tags = soup('span')
for tag in tags:
# Look at the parts of a tag
#calculate whatever you wanto
</code></pre>