Package lxml :: Module cssselect
[hide private]
[frames] | no frames]

Module cssselect

source code

CSS Selectors based on XPath.

This module supports selecting XML/HTML tags based on CSS selectors. See the CSSSelector class for details.

Classes [hide private]
  SelectorSyntaxError
  ExpressionError
  CSSSelector
A CSS selector.
  _UniToken
  Symbol
  String
  Token
  Class
Represents selector.class_name
  Function
Represents selector:name(expr)
  Pseudo
Represents selector:ident
  Attrib
Represents selector[namespace|attrib operator value]
  Element
Represents namespace|element
  Hash
Represents selector#id
  Or
  CombinedSelector
  XPathExpr
  XPathExprOr
Represents |'d expressions. Note that unfortunately it isn't the union, it's the sum, so duplicate elements will appear.
  TokenStream
Functions [hide private]
 
_make_lower_case(context, s) source code
 
css_to_xpath(css_expr, prefix='descendant-or-self::') source code
 
split_at_single_quotes(...)
split(string[, maxsplit = 0]) --> list. Split string by the occurrences of pattern.
source code
 
xpath_literal(s) source code
 
parse(string) source code
 
parse_selector_group(stream) source code
 
parse_selector(stream) source code
 
parse_simple_selector(stream) source code
 
is_int(v) source code
 
parse_attrib(selector, stream) source code
 
parse_series(s)
Parses things like '1n+2', or 'an+b' generally, returning (a, b)
source code
 
tokenize(s) source code
 
split_at_string_escapes(...)
split(string[, maxsplit = 0]) --> list. Split string by the occurrences of pattern.
source code
 
unescape_string_literal(literal) source code
 
tokenize_escaped_string(s, pos) source code
 
tokenize_symbol(s, pos) source code
Variables [hide private]
  ns = FunctionNamespace('/css/')
  _el_re = re.compile(r'(?u)^\w+\s*$')
  _id_re = re.compile(r'(?u)^(\w*)#(\w+)\s*$')
  _class_re = re.compile(r'(?u)^(\w*)\.(\w+)\s*$')
  _whitespace_re = re.compile(r'(?u)\s+')
  _comment_re = re.compile(r'(?s)/\*.*?\*/')
  _count_re = re.compile(r'[\+-]?\d*n(?:[\+-]\d+)?')
  _illegal_symbol = re.compile(r'(?u)[^\w\\-]')
  __package__ = 'lxml'