diff --git a/README.rst b/README.rst index 29cd3824..8442bde3 100644 --- a/README.rst +++ b/README.rst @@ -44,6 +44,6 @@ Example:: [u'Hello', u'Parsel'] >>> >>> for e in sel.css('ul > li'): - print(e.xpath('.//a/@href')).extract_first() + print(e.xpath('.//a/@href').extract_first()) http://example.com http://scrapy.org diff --git a/docs/usage.rst b/docs/usage.rst index 94053969..ea6773ce 100644 --- a/docs/usage.rst +++ b/docs/usage.rst @@ -114,7 +114,7 @@ If you want to extract only first matched element, you can call the selector ``. It returns ``None`` if no element was found:: - >>> selector.xpath('//div/[id="not-exists"]/text()').extract_first() is None + >>> selector.xpath('//div[@id="not-exists"]/text()').extract_first() is None True Notice that CSS selectors can select text or attribute nodes using CSS3