You've already forked dockerfiles
mirror of
https://github.com/vimagick/dockerfiles.git
synced 2025-07-13 01:10:17 +02:00
update scrapyd
This commit is contained in:
@ -121,16 +121,16 @@ class StackOverflowSpider(scrapy.Spider):
|
|||||||
def parse_question(self, response):
|
def parse_question(self, response):
|
||||||
yield {
|
yield {
|
||||||
'title': response.css('h1 a::text').extract()[0],
|
'title': response.css('h1 a::text').extract()[0],
|
||||||
'votes': response.css('.question .vote-count-post::text').extract()[0],
|
'votes': response.css('.question div[itemprop="upvoteCount"]::text').extract()[0],
|
||||||
'body': response.css('.question .post-text').extract()[0],
|
'body': response.css('.question .postcell').extract()[0],
|
||||||
'tags': response.css('.question .post-tag::text').extract(),
|
'tags': response.css('.question .post-tag::text').extract(),
|
||||||
'link': response.url,
|
'link': response.url,
|
||||||
}
|
}
|
||||||
_EOF_
|
_EOF_
|
||||||
|
|
||||||
$ docker-compose run --rm scrapy
|
$ docker-compose run --rm scrapy
|
||||||
>>> scrapy runspider stackoverflow_spider.py -o top-stackoverflow-questions.json
|
>>> scrapy runspider stackoverflow_spider.py -o top-stackoverflow-questions.jl
|
||||||
>>> cat top-stackoverflow-questions.json
|
>>> cat top-stackoverflow-questions.jl
|
||||||
>>> exit
|
>>> exit
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user