擅长:python、mysql、java
<p><code>find</code>将返回找到字符串的索引(一个数字),并且<code>strip</code>将删除字符串</em>末端的字符<em>;它不会删除“从该点向前的所有内容”。你知道吗</p>
<p>您想改用字符串切片:</p>
<pre><code>>>> s = 'hello there: world!'
>>> s.index(':')
11
>>> s[s.index(':')+1:]
' world!'
</code></pre>
<p>如果您只想知道链接是什么,请使用类似<a href="http://www.crummy.com/software/BeautifulSoup/bs4/doc/" rel="nofollow">^{<cd3>}</a>的库:</p>
<pre><code>>>> from bs4 import BeautifulSoup as bs
>>> doc = bs('<a href="http://www.uaf.edu/academics/degreeprograms/index.html">Degree Programs</a>')
>>> for link in doc.find_all('a'):
... print(link.get('href'))
...
http://www.uaf.edu/academics/degreeprograms/index.html
</code></pre>