Skip to content
Permalink
Browse files

Converted sel.xpath() calls to response.xpath() in Extracting the data

  • Loading branch information
Peter Bronez authored and kmike committed Mar 26, 2015
1 parent 19bb4d3 commit c2c6d15d96b2b5b2ecf789419a8216f96d259685
Showing with 4 additions and 4 deletions.
  1. +4 −4 docs/intro/tutorial.rst
@@ -315,19 +315,19 @@ is inside a ``<ul>`` element, in fact the *second* ``<ul>`` element.
So we can select each ``<li>`` element belonging to the sites list with this
code::

sel.xpath('//ul/li')
response.xpath('//ul/li')

And from them, the sites descriptions::

sel.xpath('//ul/li/text()').extract()
response.xpath('//ul/li/text()').extract()

The sites titles::

sel.xpath('//ul/li/a/text()').extract()
response.xpath('//ul/li/a/text()').extract()

And the sites links::

sel.xpath('//ul/li/a/@href').extract()
response.xpath('//ul/li/a/@href').extract()

As we've said before, each ``.xpath()`` call returns a list of selectors, so we can
concatenate further ``.xpath()`` calls to dig deeper into a node. We are going to use

0 comments on commit c2c6d15

Please sign in to comment.