mirror of https://github.com/scrapy/scrapy.git
Merge pull request #2039 from scrapy/backport-1.1-pr1994
[backport][1.1][DOC] Use idiomatic .extract_first() (PR #1994)
This commit is contained in:
commit
e1277ff70b
|
|
@ -36,9 +36,9 @@ voted questions on StackOverflow and scrapes some data from each page::
|
|||
|
||||
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],
|
||||
'title': response.css('h1 a::text').extract_first(),
|
||||
'votes': response.css('.question .vote-count-post::text').extract_first(),
|
||||
'body': response.css('.question .post-text').extract_first(),
|
||||
'tags': response.css('.question .post-tag::text').extract(),
|
||||
'link': response.url,
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue