feat(parser)!: Make all selection return selector objects by default
- The strings/Texthandlers are only returned by `get`/`getall`/`extract`/`extract_first`. This makes the type checking/autocompletion experience consistent. - Removed `css_first` and `xpath_first` since it doesn't make sense to leave them now. - Made the type hints more accurate in multiple places.
This commit is contained in:
@@ -15,6 +15,9 @@ class SelectorsGeneration:
|
||||
"""Generate a selector for the current element.
|
||||
:return: A string of the generated selector.
|
||||
"""
|
||||
if self._is_text_node(self._root):
|
||||
return ""
|
||||
|
||||
selectorPath = []
|
||||
target = self
|
||||
css = selection.lower() == "css"
|
||||
|
||||
Reference in New Issue
Block a user