Skip to content

Commit 149c4cd

Browse files
committed
[DOC][Overview] Use idiomatic .extract_first()
1 parent 9b3c72c commit 149c4cd

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

docs/intro/overview.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ voted questions on StackOverflow and scrapes some data from each page::
3636

3737
def parse_question(self, response):
3838
yield {
39-
'title': response.css('h1 a::text').extract()[0],
40-
'votes': response.css('.question .vote-count-post::text').extract()[0],
41-
'body': response.css('.question .post-text').extract()[0],
39+
'title': response.css('h1 a::text').extract_first(),
40+
'votes': response.css('.question .vote-count-post::text').extract_first(),
41+
'body': response.css('.question .post-text').extract_first(),
4242
'tags': response.css('.question .post-tag::text').extract(),
4343
'link': response.url,
4444
}

0 commit comments

Comments
 (0)