diff --git a/docs/intro/overview.rst b/docs/intro/overview.rst index a7d6a53c1..55605a5e8 100644 --- a/docs/intro/overview.rst +++ b/docs/intro/overview.rst @@ -132,9 +132,9 @@ Finally, here's the spider code:: torrent = ScrapedItem() torrent.url = response.url - torrent.name = x.x("//h1/text()").extract() - torrent.description = x.x("//div[@id='description']").extract() - torrent.size = x.x("//div[@id='info-left']/p[2]/text()[2]").extract() + torrent.name = x.select("//h1/text()").extract() + torrent.description = x.select("//div[@id='description']").extract() + torrent.size = x.select("//div[@id='info-left']/p[2]/text()[2]").extract() return [torrent] diff --git a/docs/intro/tutorial.rst b/docs/intro/tutorial.rst index 90de0b27c..21848591e 100644 --- a/docs/intro/tutorial.rst +++ b/docs/intro/tutorial.rst @@ -264,19 +264,19 @@ The shell also instantiates two selectors, one for HTML (in the ``hxs`` variable) and one for XML (in the ``xxs`` variable)with this response. So let's try them:: - In [1]: hxs.x('/html/head/title') + In [1]: hxs.select('/html/head/title') Out[1]: [] - In [2]: hxs.x('/html/head/title').extract() + In [2]: hxs.select('/html/head/title').extract() Out[2]: [u'Open Directory - Computers: Programming: Languages: Python: Books'] - In [3]: hxs.x('/html/head/title/text()') + In [3]: hxs.select('/html/head/title/text()') Out[3]: [] - In [4]: hxs.x('/html/head/title/text()').extract() + In [4]: hxs.select('/html/head/title/text()').extract() Out[4]: [u'Open Directory - Computers: Programming: Languages: Python: Books'] - In [5]: hxs.x('/html/head/title/text()').re('(\w+):') + In [5]: hxs.select('/html/head/title/text()').re('(\w+):') Out[5]: [u'Computers', u'Programming', u'Languages', u'Python'] Extracting the data @@ -296,29 +296,29 @@ is inside a ``