摘要: Request Request对象在我们写爬虫发送请求的时候调用,参数如下: url: 就是需要请求的url callback: 指定该请求返回的Response由那个函数来处理。 method: 请求方法,默认GET方法,可设置为"GET", "POST", "PUT"等,且保证字符串大写 hea 阅读全文
posted @ 2019-04-27 15:43 s小毛驴 阅读(526) 评论(0) 推荐(0) 编辑
摘要: crawlSpider 创建CrawlSpider模板 scrapy genspider -t crawl <爬虫名字> <域名> 模板代码示例: # -*- coding: utf-8 -*-import scrapyfrom scrapy.linkextractors import LinkEx 阅读全文
posted @ 2019-04-27 14:07 s小毛驴 阅读(626) 评论(0) 推荐(0) 编辑
摘要: Scrapy笔记 安装scrapy框架 安装scrapy: 通过pip install scrapy 如果是在Windows上面,还需要安装pypiwin32,如果不安装,那么以后运行scrapy项目的时候会报错。安装方式:pip install pypiwin32。 如果是在Ubuntu下,还需要 阅读全文
posted @ 2019-04-27 13:58 s小毛驴 阅读(248) 评论(0) 推荐(0) 编辑
返回顶部