擅长:python、mysql、java
<p>我找到了这种方法,供不想使用regex的人参考:</p>
<pre><code>r = br.open("http://www.somewebsite.com")
br.find_link(url='http://www.somewebsite.com/link1.html')
req = br.click_link(url='http://www.somewebsite.com/link1.html')
br.open(req)
print br.response().read()
</code></pre>
<p>或者,它也可以通过链接的文本工作:</p>
<pre><code>r = br.open("http://www.somewebsite.com")
br.find_link(text='Click this link')
req = br.click_link(text='Click this link')
br.open(req)
print br.response().read()
</code></pre>