再分享一条,使用requests库时候的乱码问题,在网页下载器的downloader方法中,需要返回response.content,而不能用response.text,否则会出现乱码。
2017-12-10
Undefined variable from import: urlopen有大神帮忙解决一下
2017-12-07
File "C:\Users\Administrator\eclipse-workspace\imooc\src\test\test_urllib2.py", line 2
SyntaxError: Non-ASCII character '\xc4' in file C:\Users\Administrator\eclipse-workspace\imooc\src\test\test_urllib2.py on line 3, but no encoding declared;
报这个错误的,在最前面加入这个就行了 # coding=UTF-8
SyntaxError: Non-ASCII character '\xc4' in file C:\Users\Administrator\eclipse-workspace\imooc\src\test\test_urllib2.py on line 3, but no encoding declared;
报这个错误的,在最前面加入这个就行了 # coding=UTF-8
2017-12-06
现在网址已经变成http://baike.baidu.com/item/Python,我们抓这个新网址需要修改成这句links = soup.find_all('a', href=re.compile(r"/item/(.*)"))
2017-12-05