啊我已经不吐不快了,我用的是Python3,Windows7系统,然而encode('utf-8')这个压根没有用,因为本来爬取到的数据就没有乱码的,加了这句反而乱码,不可思议
2016-10-14
最新回答 / Snail_87103145
$ pip install beautifulsoup4$ pip install html5libPython:from bs4 import BeautifulSoupimport urllib2url = 'http://www.example.com'page = urllib2.urlopen(url)soup = BeautifulSoup(page.read(), 'html5lib')links = soup.findAll('a')for link in links: print ...
2016-10-11