Rework Selectors generation

- Renamed both `css_selector` and `xpath_selector` both to `generate_css_selector` and `generate_xpath_selector` for clarity and not interrupting the auto-completion while coding.
- Added `generate_full_css_selector` and `generate_full_xpath_selector` methods
This commit is contained in:
Karim shoair
2024-11-10 18:19:48 +02:00
parent de2d65856c
commit 3d4b427168
2 changed files with 24 additions and 9 deletions
+2 -2
View File
@@ -169,8 +169,8 @@ class TestParser(unittest.TestCase):
def test_selectors_generation(self):
"""Try to create selectors for all elements in the page"""
def _traverse(element: Adaptor):
self.assertTrue(type(element.css_selector) is str)
self.assertTrue(type(element.xpath_selector) is str)
self.assertTrue(type(element.generate_css_selector) is str)
self.assertTrue(type(element.generate_xpath_selector) is str)
for branch in element.children:
_traverse(branch)