Merge pull request #1532 from hoatle/docs-fixes

Docs fixes
This commit is contained in:
Mikhail Korobov 2015-10-07 15:34:21 +05:00
commit 4e9a43c228
1 changed files with 2 additions and 2 deletions

View File

@ -146,12 +146,12 @@ If you want to extract only first matched element, you can call the selector ``.
It returns ``None`` if no element was found:
>>> response.xpath('//div/[id="not-exists"]/text()').extract_first() is None
>>> response.xpath('//div[@id="not-exists"]/text()').extract_first() is None
True
A default return value can be provided as an argument, to be used instead of ``None``:
>>> sel.xpath('//div/[id="not-exists"]/text()').extract_first(default='not-found')
>>> sel.xpath('//div[@id="not-exists"]/text()').extract_first(default='not-found')
'not-found'
Notice that CSS selectors can select text or attribute nodes using CSS3