1
0
mirror of https://github.com/scrapy/scrapy.git synced 2025-02-23 17:43:57 +00:00

Merge pull request #524 from hobsonlane/master

documentation code example corrections per pablohoffman
This commit is contained in:
Pablo Hoffman 2014-01-16 06:44:51 -08:00
commit ed6fd4933f
2 changed files with 7 additions and 2 deletions

View File

@ -129,6 +129,10 @@ For more information about XPath see the `XPath reference`_.
Finally, here's the spider code::
from scrapy.contrib.spiders import CrawlSpider, Rule
from scrapy.contrib.linkextractors.sgml import SgmlLinkExtractor
from scrapy.selector import Selector
class MininovaSpider(CrawlSpider):
name = 'mininova'
@ -145,8 +149,7 @@ Finally, here's the spider code::
torrent['size'] = sel.xpath("//div[@id='info-left']/p[2]/text()[2]").extract()
return torrent
For brevity's sake, we intentionally left out the import statements. The
Torrent item is :ref:`defined above <intro-overview-item>`.
The ``TorrentItem`` class is :ref:`defined above <intro-overview-item>`.
Run the spider to extract the data
==================================

View File

@ -281,6 +281,8 @@ HttpAuthMiddleware
Example::
from scrapy.contrib.spiders import CrawlSpider
class SomeIntranetSiteSpider(CrawlSpider):
http_user = 'someuser'