From 1d106f859922ed4cb7d64d91bc23fbee1c7535da Mon Sep 17 00:00:00 2001 From: kev Date: Mon, 1 Feb 2021 16:42:49 +0800 Subject: [PATCH] update scrapyd --- scrapyd/README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scrapyd/README.md b/scrapyd/README.md index a0a4d42..db7d95c 100644 --- a/scrapyd/README.md +++ b/scrapyd/README.md @@ -121,16 +121,16 @@ class StackOverflowSpider(scrapy.Spider): def parse_question(self, response): yield { 'title': response.css('h1 a::text').extract()[0], - 'votes': response.css('.question .vote-count-post::text').extract()[0], - 'body': response.css('.question .post-text').extract()[0], + 'votes': response.css('.question div[itemprop="upvoteCount"]::text').extract()[0], + 'body': response.css('.question .postcell').extract()[0], 'tags': response.css('.question .post-tag::text').extract(), 'link': response.url, } _EOF_ $ docker-compose run --rm scrapy ->>> scrapy runspider stackoverflow_spider.py -o top-stackoverflow-questions.json ->>> cat top-stackoverflow-questions.json +>>> scrapy runspider stackoverflow_spider.py -o top-stackoverflow-questions.jl +>>> cat top-stackoverflow-questions.jl >>> exit ```