from BeautifulSoup import BeautifulSoup
import urllib2
content = url.read()
soup = BeautifulSoup(content)
links = soup.findAll("a") 复制代码
如下内容内容是关于python通过BeautifulSoup获取网页上的所有超级链接的内容,应该对码农有所用。