Merge pull request #489 from RasPat1/patch-2

Note about selector class import
This commit is contained in:
Pablo Hoffman 2013-12-16 06:40:59 -08:00
commit 462e40acd0
1 changed files with 2 additions and 0 deletions

View File

@ -363,6 +363,8 @@ Let's add this code to our spider::
desc = site.xpath('text()').extract()
print title, link, desc
Notice we import our Selector class from scrapy.selector and instantiate a
new Selector object. We can now specify our XPaths just as we did in the shell.
Now try crawling the dmoz.org domain again and you'll see sites being printed
in your output, run::