File: dummysel.py

package info (click to toggle)
python-scrapy 0.14.4-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 3,064 kB
  • sloc: python: 19,468; xml: 199; sh: 134; makefile: 67
file content (22 lines) | stat: -rw-r--r-- 539 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
"""
Dummy selectors
"""

from .list import XPathSelectorList as XPathSelectorList

__all__ = ['HtmlXPathSelector', 'XmlXPathSelector', 'XPathSelector', \
    'XPathSelectorList']

class XPathSelector(object):

    def __init__(self, *a, **kw):
        pass

    def _raise(self, *a, **kw):
        raise RuntimeError("No selectors backend available. " \
            "Please install libxml2 or lxml")

    select = re = extract = register_namespace = __nonzero__ = _raise

XmlXPathSelector = XPathSelector
HtmlXPathSelector = XPathSelector