摘要: 1 import requests 2 import re 3 import json 4 from requests.exceptions import RequestException 5 from multiprocessing import Pool 6 7 def get_one_page(url): 8 headers = { 9 "Use... 阅读全文
posted @ 2017-12-02 23:54 不可叽叽歪歪 阅读(227) 评论(0) 推荐(0) 编辑
摘要: json.dumps(contnet,+'\n') 阅读全文
posted @ 2017-12-02 22:42 不可叽叽歪歪 阅读(91) 评论(0) 推荐(0) 编辑
摘要: json.dumps(content,ensure_ascii=False) 阅读全文
posted @ 2017-12-02 22:40 不可叽叽歪歪 阅读(167) 评论(0) 推荐(0) 编辑
摘要: requests库解析时 r.encoding='utf-8' 阅读全文
posted @ 2017-12-02 22:37 不可叽叽歪歪 阅读(93) 评论(0) 推荐(0) 编辑
摘要: string1 = '\xa1\xa1\xb0\xe9' #GBK下显示为“ 伴” string2 = '\xb0\xa1\xa1\xe9' #GBK下显示为“啊¢” print string1.decode('GBK').replace(u'\u3000', u'') #输出“伴” print s 阅读全文
posted @ 2017-12-02 22:36 不可叽叽歪歪 阅读(7413) 评论(1) 推荐(0) 编辑