From f9fc8a1b65edde2176b179276d3332663e31a128 Mon Sep 17 00:00:00 2001 From: Pablo Hoffman Date: Sun, 29 Jun 2008 05:34:28 +0000 Subject: [PATCH] exported XmlXPathSelector and HtmlXPathSelector in scrapy.xpath, changed scrape command to instantiate those --HG-- extra : convert_revision : svn%3Ab85faa78-f9eb-468e-a121-7cced6da292c%4029 --- scrapy/trunk/scrapy/command/commands/scrape.py | 5 +++-- scrapy/trunk/scrapy/xpath/__init__.py | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/scrapy/trunk/scrapy/command/commands/scrape.py b/scrapy/trunk/scrapy/command/commands/scrape.py index 563271f52..840c5f0df 100644 --- a/scrapy/trunk/scrapy/command/commands/scrape.py +++ b/scrapy/trunk/scrapy/command/commands/scrape.py @@ -2,7 +2,7 @@ import scrapy from scrapy.command import ScrapyCommand from scrapy.fetcher import fetch from scrapy.spider import spiders -from scrapy.xpath import XPathSelector +from scrapy.xpath import XmlXPathSelector, HtmlXPathSelector from scrapy.utils.misc import load_class from scrapy.extension import extensions from scrapy.conf import settings @@ -14,7 +14,8 @@ def load_url(url, response): vars['item'] = item vars['url'] = url vars['response'] = response - vars['xs'] = XPathSelector(response) + vars['xxs'] = XmlXPathSelector(response) + vars['hxs'] = HtmlXPathSelector(response) vars['spider'] = spiders.fromurl(url) return vars diff --git a/scrapy/trunk/scrapy/xpath/__init__.py b/scrapy/trunk/scrapy/xpath/__init__.py index a221e53a0..e4bd3539a 100644 --- a/scrapy/trunk/scrapy/xpath/__init__.py +++ b/scrapy/trunk/scrapy/xpath/__init__.py @@ -11,5 +11,5 @@ spiders, for convenience. """ from scrapy.xpath.types import XPath -from scrapy.xpath.selector import XPathSelector +from scrapy.xpath.selector import XPathSelector, XmlXPathSelector, HtmlXPathSelector from scrapy.xpath.iterator import XMLNodeIterator