擅长:python、mysql、java
<p>为什么不使用<code>BeautifulSoup</code>?你知道吗</p>
<pre><code>In [44]: from bs4 import BeautifulSoup
In [45]: soup = BeautifulSoup ('''<a href="/define.php?term=dubstep&defid=5175360">dubstep</a> the music that is created from transformers having s$#''')
In [46]: soup.find('a').text
Out[46]: u'dubstep'
</code></pre>
<p>编辑:</p>
<p>或者如果你只想发短信:</p>
<pre><code>In [48]: soup.text
Out[48]: u'dubstep the music that is created from transformers having s$#'
</code></pre>