python通过BeautifulSoup分页网页中的超级链接,,from Beautif


from BeautifulSoup import BeautifulSoupimport urllib2import reurl = urllib2.urlopen("http://www.byrx.net")content = url.read()soup = BeautifulSoup(content)for a in soup.findAll('a',href=True):    if re.findall('sharejs', a['href']):        print "Found the URL:", a['href']

评论关闭