mirror of
https://github.com/scrapy/scrapy.git
synced 2025-02-21 07:52:49 +00:00
exported XmlXPathSelector and HtmlXPathSelector in scrapy.xpath, changed scrape command to instantiate those
--HG-- extra : convert_revision : svn%3Ab85faa78-f9eb-468e-a121-7cced6da292c%4029
This commit is contained in:
parent
6cc91df9ed
commit
f9fc8a1b65
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user