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:
Paul Tremberth 2016-06-08 17:30:15 +02:00
commit e1277ff70b
1 changed files with 3 additions and 3 deletions

View File

@ -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,
}