from BeautifulSoup import BeautifulSoup
import urllib2
import re
user = raw_input('begin here!: ')
base = ("http://1337x.org/search/")
print (base + user)
add_on = "/0/"
total_link = (base + user + add_on)
html_data = urllib2.urlopen(total_link, 'r').read()
soup = BeautifulSoup(html_data)
announce = soup.find('a', attrs={'href': re.compile("^/announcelist")})
print announce
我正在尝试检索一个 torrent 链接,最好是第一个非赞助链接。从一个页面,然后让它打印链接。我对这种编码相当陌生,因此您可以提供尽可能多的细节将是完美的!非常感谢你的帮助!