Open
Description
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).- 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
xpath
method is called on a selector instantiated with selectolax as parser raiseNotImplementedError
.
Low level changes -
- Add selectolax to the list of parsers in
_ctgroup
and modifycreate_root_node
to instantiate the selected parser with the provided data. - Modify the
xpath
andcss
methods behavior to use both selectolax and lxml or write separate methods or classes to handle them. - Utilize
HTMLParser
class in Selectolax and itscss
method to apply the css expression specified and return the data collected. - Create a
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
Metadata
Metadata
Assignees
Labels
No labels