2012年7月26日

beautifulsoup的使用

摘要: 靓汤很好用,代码直接减少一半 1 urls = [] 2 queue = Queue.Queue() 3 4 def geturl(url): 5 6 html = urllib2.urlopen(url).read() 7 soup = BeautifulSoup(html) 8 tag_a = soup.findAll('a', href=True) 9 for i in tag_a:10 s = i['href']11 if s.startswith('#'):12 pass13 ... 阅读全文

posted @ 2012-07-26 16:33 h3idan 阅读(324) 评论(0) 推荐(0) 编辑

导航