Copied!

CSS selector parser.

This component is a port of the Python cssselect library, which is copyright Ian Bicking, @see https://github.com/scrapy/cssselect.

CloneableInstantiable
Methods
public __construct(?Symfony\Component\CssSelector\Parser\Tokenizer\Tokenizer $tokenizer = NULL)
public parse(string $source) : array
public static parseSeries(array $tokens) : array
 

Parses the arguments for ":nth-child()" and friends.

  • param \Token[] $tokens
  • throws \SyntaxErrorException
Properties
private Symfony\Component\CssSelector\Parser\Tokenizer\Tokenizer $tokenizer
Methods
private parseAttributeNode(Symfony\Component\CssSelector\Node\NodeInterface $selector, Symfony\Component\CssSelector\Parser\TokenStream $stream) : Symfony\Component\CssSelector\Node\AttributeNode
private parseElementNode(Symfony\Component\CssSelector\Parser\TokenStream $stream) : Symfony\Component\CssSelector\Node\ElementNode
private parserSelectorNode(Symfony\Component\CssSelector\Parser\TokenStream $stream, bool $isArgument = false) : Symfony\Component\CssSelector\Node\SelectorNode
private parseSelectorList(Symfony\Component\CssSelector\Parser\TokenStream $stream, bool $isArgument = false) : array
private parseSimpleSelector(Symfony\Component\CssSelector\Parser\TokenStream $stream, bool $insideNegation = false, bool $isArgument = false) : array
 

Parses next simple node (hash, class, pseudo, negation).

  • throws \SyntaxErrorException
Methods
public static parseSeries(array $tokens) : array
 

Parses the arguments for ":nth-child()" and friends.

  • param \Token[] $tokens
  • throws \SyntaxErrorException
© 2024 Bruce Wells
Search Namespaces \ Classes
Configuration