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
 
_match_whitespace(...)
match(string[, pos[, endpos]]) --> match object or None. Matches zero or more characters at the beginning of the string
source code
 
_replace_comments(...)
sub(repl, string[, count = 0]) --> newstring Return the string obtained by replacing the leftmost non-overlapping occurrences of pattern in string by the replacement repl.
source code
 
_match_count_number(...)
match(string[, pos[, endpos]]) --> match object or None. Matches zero or more characters at the beginning of the string
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('http://codespeak.net/lxml/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*$')
  _illegal_symbol = re.compile(r'(?u)[^\w\\-]')
  __package__ = 'lxml'