摘要: Scrapyd是一个应用程序,允许我们在服务器上部署爬虫,并使用它们来安排爬虫作业 项目部署到服务器 cat scrapy.cfg ... [deploy:scrapyd1] url = http://scrapyd1:6800/ [deploy:scrapyd2] url = http://scr 阅读全文
posted @ 2017-12-13 10:51 不可叽叽歪歪 阅读(119) 评论(0) 推荐(0) 编辑
摘要: 写入到MySQL 阅读全文
posted @ 2017-12-13 10:46 不可叽叽歪歪 阅读(65) 评论(0) 推荐(0) 编辑
摘要: Analysis 性能 停止抓取 HTTP缓存和脱机 爬行风格 Feed 媒体下载 Amazon Web Services‌ 使用代理服务器 阅读全文
posted @ 2017-12-13 10:26 不可叽叽歪歪 阅读(105) 评论(0) 推荐(0) 编辑
摘要: 基本设置 阅读全文
posted @ 2017-12-13 10:16 不可叽叽歪歪 阅读(82) 评论(0) 推荐(0) 编辑
摘要: http://scrapinghub.com 阅读全文
posted @ 2017-12-13 10:08 不可叽叽歪歪 阅读(89) 评论(0) 推荐(0) 编辑
摘要: def parse(self, response): # Get the next index URLs and yield Requests next_sel = response.xpath('//*[contains(@class,"next")]//@href') for url in next_sel.extract(): yield Request(urlparse.urljoin(... 阅读全文
posted @ 2017-12-13 10:07 不可叽叽歪歪 阅读(139) 评论(0) 推荐(0) 编辑
摘要: title = item [“title”] yield Request(url,meta = {“title”:title},callback = self.parse_item) l.add_value('title',response.meta ['title'],MapCompose(unicode.stripunicode.title)) 阅读全文
posted @ 2017-12-13 10:04 不可叽叽歪歪 阅读(98) 评论(0) 推荐(0) 编辑
摘要: def parse(self, response): base_url = "http://web:9312/properties/" js = json.loads(response.body) for item in js: id = item["id"] url = base_url + "property_%06d.html" % id yield Request(url, callba... 阅读全文
posted @ 2017-12-13 09:59 不可叽叽歪歪 阅读(116) 评论(0) 推荐(0) 编辑
摘要: 确认启用了Cookie 阅读全文
posted @ 2017-12-13 09:58 不可叽叽歪歪 阅读(118) 评论(0) 推荐(0) 编辑
摘要: Appery.io pip install --upgrade scrapyapperyio pip install --upgrade scrapyapperyio 阅读全文
posted @ 2017-12-13 09:51 不可叽叽歪歪 阅读(89) 评论(0) 推荐(0) 编辑
摘要: 将用两个规则替换预定义的规则变量,一个用于水平,一个用于垂直爬 阅读全文
posted @ 2017-12-13 09:49 不可叽叽歪歪 阅读(85) 评论(0) 推荐(0) 编辑
摘要: myFunction = lambda i: i.replace(',', '') def myFunction(i): return i.replace(',', '') 阅读全文
posted @ 2017-12-13 09:26 不可叽叽歪歪 阅读(267) 评论(0) 推荐(0) 编辑
摘要: 1 def parse(self,response): 2 l = ItemLoader(item = PropertiesItem(),response = response) 3 4 l.add_xpath('title','// * [@ itemprop =“name”] [1] / tex 阅读全文
posted @ 2017-12-13 09:24 不可叽叽歪歪 阅读(124) 评论(0) 推荐(0) 编辑
摘要: scrapy crawl spider -o item.json scrapy crawl basic -o“ftp:// user:pass@ftp.scrapybook.com/items.json” 阅读全文
posted @ 2017-12-13 09:21 不可叽叽歪歪 阅读(104) 评论(0) 推荐(0) 编辑
摘要: Scrapy使用后进先出(LIFO)策略来处理请求(深度优先抓取)。你提交的最后一个请求将被首先处理 阅读全文
posted @ 2017-12-13 09:19 不可叽叽歪歪 阅读(156) 评论(0) 推荐(0) 编辑
摘要: 一; 阅读全文
posted @ 2017-12-13 08:51 不可叽叽歪歪 阅读(103) 评论(0) 推荐(0) 编辑
摘要: 1 import scrapy.cmdline 2 3 cmdline.execute('scrapy crawl myspider'.split() 阅读全文
posted @ 2017-12-13 08:46 不可叽叽歪歪 阅读(263) 评论(0) 推荐(0) 编辑
摘要: scrapy框架图 阅读全文
posted @ 2017-12-13 08:43 不可叽叽歪歪 阅读(131) 评论(0) 推荐(0) 编辑