摘要: - 图片懒加载 - 应用到标签的伪属性,数据捕获的时候一定是基于伪属性进行!!!- ImagePileline:专门用作于二进制数据下载和持久化存储的管道类- CrawlSpider - 一种基于scrapy进行全站数据爬取的一种新的技术手段。 - CrawlSpider就是Spider的一个子类 阅读全文
posted @ 2020-03-07 17:26 干it的小张 阅读(306) 评论(1) 推荐(0) 编辑
摘要: 1、创建项目scrapy startproject 爬虫项目名字2、创建虫子scrapy genspider 虫名字3、setting里面加UA伪装4、加LOG_LEVEL级别、ROBOTSTXT_OBEY = False5、虫名字里面爬取网站和解析数据6、item里面增加爬取的数据7、settin 阅读全文
posted @ 2020-03-07 11:39 干it的小张 阅读(329) 评论(1) 推荐(0) 编辑
摘要: huya.py # -*- coding: utf-8 -*-import scrapyfrom huyaPro1.items import Huyapro1Itemclass HuyaSpider(scrapy.Spider): name = 'huya' # allowed_domains = 阅读全文
posted @ 2020-03-07 01:34 干it的小张 阅读(159) 评论(0) 推荐(0) 编辑
摘要: # -*- coding: utf-8 -*-import scrapyfrom huyaAll1.items import Huyaall1Itemclass HuyaSpider(scrapy.Spider): name = 'huya' # allowed_domains = ['www.xx 阅读全文
posted @ 2020-03-07 01:30 干it的小张 阅读(270) 评论(0) 推荐(0) 编辑
摘要: # -*- coding: utf-8 -*-# Define here the models for your spider middleware## See documentation in:# https://docs.scrapy.org/en/latest/topics/spider-mi 阅读全文
posted @ 2020-03-07 01:27 干it的小张 阅读(201) 评论(0) 推荐(0) 编辑
摘要: movie.py虫子 # -*- coding: utf-8 -*-import scrapyfrom moviePro1.items import Moviepro1Itemclass MovieSpider(scrapy.Spider): name = 'movie' # allowed_dom 阅读全文
posted @ 2020-03-07 01:25 干it的小张 阅读(7259) 评论(0) 推荐(0) 编辑
摘要: 创建项目: scrapy startproject wangyi 创建虫子: scrapy genspider wangyi www.xxx.com :创建爬虫文件 执行:scrapy crawl spiderName wangyi.py 虫子 # -*- coding: utf-8 -*-impo 阅读全文
posted @ 2020-03-07 01:22 干it的小张 阅读(405) 评论(0) 推荐(0) 编辑
摘要: - 管道的持久化存储: - 数据解析(爬虫类) - 将解析的数据封装到item类型的对象中(爬虫类) - 将item提交给管道:yield item(爬虫类) - 在官大类的process_item中接收item对象并且进行任意形式的持久化存储操作(管道类) - 在配置文件中开启管道 - 细节: - 阅读全文
posted @ 2020-03-07 01:15 干it的小张 阅读(198) 评论(0) 推荐(0) 编辑