-
Notifications
You must be signed in to change notification settings - Fork 146
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Discussion on implementing selectolax support #239
Comments
Your plan so far is looking good to me. Some thoughts:
|
JMESPath and JSON support -
The following methods may not be supported while using selectolax as parser -
XML and XHTML5:
Things that I want to add I to the list of changes:
@Gallaecio Can you please review this and suggest the changes that I have to make? |
|
|
So you are thinking of transforming an input expression with unsupported syntax into an equivalent expression with supported syntax before you pass it to Selectolax? That may work for unsupported syntax that is syntax sugar, but I do not see how that would work for things that cannot be otherwise expressed with supported syntax (
I think you may be overestimating how complex CSS Selector expressions can be. For example, how do you handle |
I was thinking of applying the CSS expression by removing the |
|
Here are some of the changes I thought of implementing
High level changes -
Selector
class takes a new argument "parser" which indicates which parser backend to use (lxml or selectolax).xpath
method is called on a selector instantiated with selectolax as parser raiseNotImplementedError
.Low level changes -
_ctgroup
and modifycreate_root_node
to instantiate the selected parser with the provided data.xpath
andcss
methods behavior to use both selectolax and lxml or write separate methods or classes to handle them.HTMLParser
class in Selectolax and itscss
method to apply the css expression specified and return the data collected.Selectorlist
withSelector
objects created with the type and parser specified.This is still a work in progress and I will make a lot of changes, Please suggest the changes that need to made to the current list
The text was updated successfully, but these errors were encountered: