用Python3.x抓取GB2312编码方式的网站很容易出现乱码,原代码如图所示:
import requests
res = requests.get('http://www.jjwxc.net/onebook.php?novelid=1231454&chapterid=1')
res.encoding = res.apparent_encoding
novel = res.text
res.close()
with open('test1.txt', mode
用Python3.x抓取GB2312编码方式的网站很容易出现乱码,原代码如图所示:
import requests
res = requests.get('http://www.jjwxc.net/onebook.php?novelid=1231454&chapterid=1')
res.encoding = res.apparent_encoding
novel = res.text
res.close()
with open('test1.txt', mode
7037
3369
611
4万+

被折叠的 条评论
为什么被折叠?
