摘要: 前提条件: 防止乱码产生 ITEM_PIPELINES = { 'xpc.pipelines.ExcelPipeline': 300, } 方法一 1、安装openpyxl conda install openpyxl 2、pipline from openpyxl import Workbook 阅读全文
posted @ 2019-11-15 17:21 市丸银 阅读(631) 评论(0) 推荐(0) 编辑
摘要: 在settings.py文件中添加 FEED_EXPORT_ENCODING = 'utf-8' 阅读全文
posted @ 2019-11-15 16:08 市丸银 阅读(519) 评论(0) 推荐(0) 编辑
摘要: 一、调试 scrapy view url 下载url # console端,输入下面命令 scrapy shell url # 进入python交互模式,查看打印的结果是否符合预期 response.xpath('') 我一般用于检测xpath是否正确 二、查看cookies debug COOKI 阅读全文
posted @ 2019-11-15 14:55 市丸银 阅读(843) 评论(0) 推荐(0) 编辑
摘要: 一、去重 # 去重 DUPEFILTER_CLASS = 'scrapy_redis.dupefilter.RFPDupeFilter' # 连接redis REDIS_URL = 'redis://user:密码@ip:端口' # 注意:无用户密码时,不用加@符号 # 爬虫停止时,redis中的数 阅读全文
posted @ 2019-11-15 10:01 市丸银 阅读(68) 评论(0) 推荐(0) 编辑
摘要: 1、debug调式,settings文件 COOKIES_ENABLED = True COOKIES_DEBUG = True 2、合并cookies request.meta['dont_merge_cookies'] = True 阅读全文
posted @ 2019-11-15 00:04 市丸银 阅读(79) 评论(0) 推荐(0) 编辑