最新回答 / 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
soup = BeautifulSoup(html_doc, 'html.parser', from_encoding = 'utf8')
2016-10-09
最新回答 / 慕仔5574918
try: new_url = self.url.get_new_url().encode('utf-8')刚改好,如果你是python2.7版本,需要在此处加上 encode('utf-8'),本人亲验
2016-10-08