-
Notifications
You must be signed in to change notification settings - Fork 160
Discussion on implementing selectolax support #239
Copy link
Copy link
Open
Description
Here are some of the changes I thought of implementing
High level changes -
Selectorclass takes a new argument "parser" which indicates which parser backend to use (lxml or selectolax).- Selectolax itself provides two backends Lexbor and Modest by default it uses the Modest backend. Should additional support for lexbor be added? We could use modest by default and have the users pass an argument if they want to use lexbor
- If the "parser" argument is not provided lxml will be used by default, since I thought it preserves the current behavior and allows backward support. It also allows the test suite to be used without changes to all the existing methods.
- If the
xpathmethod is called on a selector instantiated with selectolax as parser raiseNotImplementedError.
Low level changes -
- Add selectolax to the list of parsers in
_ctgroupand modifycreate_root_nodeto instantiate the selected parser with the provided data. - Modify the
xpathandcssmethods behavior to use both selectolax and lxml or write separate methods or classes to handle them. - Utilize
HTMLParserclass in Selectolax and itscssmethod to apply the css expression specified and return the data collected. - Create a
SelectorlistwithSelectorobjects 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
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels