随笔分类 - spider
摘要:最近电脑崩了好几次, 恢复备份使用的是pip的默认源, 不想百度,写个记录给自己看: 国内的一些源: 阿里云 http://mirrors.aliyun.com/pypi/simple/ 中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/ 豆瓣(douba
阅读全文
摘要:scrapy利用FilesPipline实现了文件的下载, 因此如果想要重名文件,只需要重写这个类 class MyfilesPipeline(FilesPipeline): def file_downloaded(self, response, request, info): """ 文件下载完成
阅读全文
摘要:"""CloseSpider is an extension that forces spiders to be closed after certain conditions are met. See documentation in docs/topics/extensions.rst """
阅读全文
摘要:scrapy 默认的是utf-8的格式进行编码,在利用链接提取器LinkExtractor进行深度爬取的时候, 返回的Response中的url链接中可能会含有中文关键字,如果不进行处理的情况下scrapy会自动的将中关键字以utf-8的格式进行编码后再去请求这个url,但是网站的解析格式可能不是u
阅读全文