QWeb 3.3.0__tar.gz → 3.3.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {QWeb-3.3.0 → QWeb-3.3.1}/PKG-INFO +1 -1
- {QWeb-3.3.0 → QWeb-3.3.1}/QWeb/_version.py +3 -3
- {QWeb-3.3.0 → QWeb-3.3.1}/QWeb/internal/text.py +41 -11
- {QWeb-3.3.0 → QWeb-3.3.1}/QWeb.egg-info/PKG-INFO +1 -1
- {QWeb-3.3.0 → QWeb-3.3.1}/LICENSE +0 -0
- {QWeb-3.3.0 → QWeb-3.3.1}/MANIFEST.in +0 -0
- {QWeb-3.3.0 → QWeb-3.3.1}/QWeb/__init__.py +0 -0
- {QWeb-3.3.0 → QWeb-3.3.1}/QWeb/__main__.py +0 -0
- {QWeb-3.3.0 → QWeb-3.3.1}/QWeb/custom_config.py +0 -0
- {QWeb-3.3.0 → QWeb-3.3.1}/QWeb/internal/__init__.py +0 -0
- {QWeb-3.3.0 → QWeb-3.3.1}/QWeb/internal/actions.py +0 -0
- {QWeb-3.3.0 → QWeb-3.3.1}/QWeb/internal/ajax.py +0 -0
- {QWeb-3.3.0 → QWeb-3.3.1}/QWeb/internal/alert.py +0 -0
- {QWeb-3.3.0 → QWeb-3.3.1}/QWeb/internal/blocks.py +0 -0
- {QWeb-3.3.0 → QWeb-3.3.1}/QWeb/internal/browser/__init__.py +0 -0
- {QWeb-3.3.0 → QWeb-3.3.1}/QWeb/internal/browser/android.py +0 -0
- {QWeb-3.3.0 → QWeb-3.3.1}/QWeb/internal/browser/bs_desktop.py +0 -0
- {QWeb-3.3.0 → QWeb-3.3.1}/QWeb/internal/browser/bs_mobile.py +0 -0
- {QWeb-3.3.0 → QWeb-3.3.1}/QWeb/internal/browser/chrome.py +0 -0
- {QWeb-3.3.0 → QWeb-3.3.1}/QWeb/internal/browser/edge.py +0 -0
- {QWeb-3.3.0 → QWeb-3.3.1}/QWeb/internal/browser/firefox.py +0 -0
- {QWeb-3.3.0 → QWeb-3.3.1}/QWeb/internal/browser/safari.py +0 -0
- {QWeb-3.3.0 → QWeb-3.3.1}/QWeb/internal/checkbox.py +0 -0
- {QWeb-3.3.0 → QWeb-3.3.1}/QWeb/internal/config.py +0 -0
- {QWeb-3.3.0 → QWeb-3.3.1}/QWeb/internal/config_defaults.py +0 -0
- {QWeb-3.3.0 → QWeb-3.3.1}/QWeb/internal/cookies.py +0 -0
- {QWeb-3.3.0 → QWeb-3.3.1}/QWeb/internal/decorators.py +0 -0
- {QWeb-3.3.0 → QWeb-3.3.1}/QWeb/internal/download.py +0 -0
- {QWeb-3.3.0 → QWeb-3.3.1}/QWeb/internal/dragdrop.py +0 -0
- {QWeb-3.3.0 → QWeb-3.3.1}/QWeb/internal/dropdown.py +0 -0
- {QWeb-3.3.0 → QWeb-3.3.1}/QWeb/internal/element.py +0 -0
- {QWeb-3.3.0 → QWeb-3.3.1}/QWeb/internal/exceptions.py +0 -0
- {QWeb-3.3.0 → QWeb-3.3.1}/QWeb/internal/file.py +0 -0
- {QWeb-3.3.0 → QWeb-3.3.1}/QWeb/internal/frame.py +0 -0
- {QWeb-3.3.0 → QWeb-3.3.1}/QWeb/internal/frame_checker.py +0 -0
- {QWeb-3.3.0 → QWeb-3.3.1}/QWeb/internal/icon.py +0 -0
- {QWeb-3.3.0 → QWeb-3.3.1}/QWeb/internal/input_.py +0 -0
- {QWeb-3.3.0 → QWeb-3.3.1}/QWeb/internal/input_handler.py +0 -0
- {QWeb-3.3.0 → QWeb-3.3.1}/QWeb/internal/javascript.py +0 -0
- {QWeb-3.3.0 → QWeb-3.3.1}/QWeb/internal/lists.py +0 -0
- {QWeb-3.3.0 → QWeb-3.3.1}/QWeb/internal/meas.py +0 -0
- {QWeb-3.3.0 → QWeb-3.3.1}/QWeb/internal/platform.py +0 -0
- {QWeb-3.3.0 → QWeb-3.3.1}/QWeb/internal/screenshot.py +0 -0
- {QWeb-3.3.0 → QWeb-3.3.1}/QWeb/internal/search_strategy.py +0 -0
- {QWeb-3.3.0 → QWeb-3.3.1}/QWeb/internal/secrets.py +0 -0
- {QWeb-3.3.0 → QWeb-3.3.1}/QWeb/internal/table.py +0 -0
- {QWeb-3.3.0 → QWeb-3.3.1}/QWeb/internal/user.py +0 -0
- {QWeb-3.3.0 → QWeb-3.3.1}/QWeb/internal/util.py +0 -0
- {QWeb-3.3.0 → QWeb-3.3.1}/QWeb/internal/window.py +0 -0
- {QWeb-3.3.0 → QWeb-3.3.1}/QWeb/internal/xhr.py +0 -0
- {QWeb-3.3.0 → QWeb-3.3.1}/QWeb/keywords/__init__.py +0 -0
- {QWeb-3.3.0 → QWeb-3.3.1}/QWeb/keywords/ajax.py +0 -0
- {QWeb-3.3.0 → QWeb-3.3.1}/QWeb/keywords/alert.py +0 -0
- {QWeb-3.3.0 → QWeb-3.3.1}/QWeb/keywords/blocks.py +0 -0
- {QWeb-3.3.0 → QWeb-3.3.1}/QWeb/keywords/browser.py +0 -0
- {QWeb-3.3.0 → QWeb-3.3.1}/QWeb/keywords/checkbox.py +0 -0
- {QWeb-3.3.0 → QWeb-3.3.1}/QWeb/keywords/config.py +0 -0
- {QWeb-3.3.0 → QWeb-3.3.1}/QWeb/keywords/cookies.py +0 -0
- {QWeb-3.3.0 → QWeb-3.3.1}/QWeb/keywords/debug.py +0 -0
- {QWeb-3.3.0 → QWeb-3.3.1}/QWeb/keywords/download.py +0 -0
- {QWeb-3.3.0 → QWeb-3.3.1}/QWeb/keywords/dragdrop.py +0 -0
- {QWeb-3.3.0 → QWeb-3.3.1}/QWeb/keywords/dropdown.py +0 -0
- {QWeb-3.3.0 → QWeb-3.3.1}/QWeb/keywords/element.py +0 -0
- {QWeb-3.3.0 → QWeb-3.3.1}/QWeb/keywords/file.py +0 -0
- {QWeb-3.3.0 → QWeb-3.3.1}/QWeb/keywords/frame.py +0 -0
- {QWeb-3.3.0 → QWeb-3.3.1}/QWeb/keywords/icon.py +0 -0
- {QWeb-3.3.0 → QWeb-3.3.1}/QWeb/keywords/input_.py +0 -0
- {QWeb-3.3.0 → QWeb-3.3.1}/QWeb/keywords/javascript.py +0 -0
- {QWeb-3.3.0 → QWeb-3.3.1}/QWeb/keywords/lists.py +0 -0
- {QWeb-3.3.0 → QWeb-3.3.1}/QWeb/keywords/screenshot.py +0 -0
- {QWeb-3.3.0 → QWeb-3.3.1}/QWeb/keywords/search_strategy.py +0 -0
- {QWeb-3.3.0 → QWeb-3.3.1}/QWeb/keywords/table.py +0 -0
- {QWeb-3.3.0 → QWeb-3.3.1}/QWeb/keywords/text.py +0 -0
- {QWeb-3.3.0 → QWeb-3.3.1}/QWeb/keywords/window.py +0 -0
- {QWeb-3.3.0 → QWeb-3.3.1}/QWeb.egg-info/SOURCES.txt +0 -0
- {QWeb-3.3.0 → QWeb-3.3.1}/QWeb.egg-info/dependency_links.txt +0 -0
- {QWeb-3.3.0 → QWeb-3.3.1}/QWeb.egg-info/not-zip-safe +0 -0
- {QWeb-3.3.0 → QWeb-3.3.1}/QWeb.egg-info/requires.txt +0 -0
- {QWeb-3.3.0 → QWeb-3.3.1}/QWeb.egg-info/top_level.txt +0 -0
- {QWeb-3.3.0 → QWeb-3.3.1}/README.md +0 -0
- {QWeb-3.3.0 → QWeb-3.3.1}/setup.cfg +0 -0
- {QWeb-3.3.0 → QWeb-3.3.1}/setup.py +0 -0
- {QWeb-3.3.0 → QWeb-3.3.1}/versioneer.py +0 -0
|
@@ -8,11 +8,11 @@ import json
|
|
|
8
8
|
|
|
9
9
|
version_json = '''
|
|
10
10
|
{
|
|
11
|
-
"date": "2024-05-
|
|
11
|
+
"date": "2024-05-22T15:39:23+0300",
|
|
12
12
|
"dirty": false,
|
|
13
13
|
"error": null,
|
|
14
|
-
"full-revisionid": "
|
|
15
|
-
"version": "v3.3.
|
|
14
|
+
"full-revisionid": "17e1c21838fcba8fb0a839efefe66df28dd0d45e",
|
|
15
|
+
"version": "v3.3.1"
|
|
16
16
|
}
|
|
17
17
|
''' # END VERSION_JSON
|
|
18
18
|
|
|
@@ -176,7 +176,7 @@ def get_all_text_elements(text: str, **kwargs) -> list[WebElement]:
|
|
|
176
176
|
|
|
177
177
|
if "css" not in kwargs:
|
|
178
178
|
try:
|
|
179
|
-
web_elements =
|
|
179
|
+
web_elements = get_clickable_elements(text, shadow_dom=shadow_dom, **kwargs)
|
|
180
180
|
except (
|
|
181
181
|
JavascriptException,
|
|
182
182
|
WebDriverException,
|
|
@@ -428,21 +428,51 @@ def _get_anchor_with_inner_text(
|
|
|
428
428
|
|
|
429
429
|
|
|
430
430
|
@frame.all_frames
|
|
431
|
-
def
|
|
431
|
+
def get_clickable_elements(
|
|
432
432
|
locator: str, shadow_dom: bool = False, **kwargs
|
|
433
433
|
) -> Optional[list[WebElement]]:
|
|
434
|
+
"""
|
|
435
|
+
Retrieve clickable elements based on a locator string.
|
|
436
|
+
|
|
437
|
+
Args:
|
|
438
|
+
locator (str): The string to locate elements by.
|
|
439
|
+
shadow_dom (bool): Whether to search within shadow DOM.
|
|
440
|
+
partial_match (bool): Whether to use partial matching.
|
|
441
|
+
**kwargs: Additional keyword arguments.
|
|
442
|
+
|
|
443
|
+
Returns:
|
|
444
|
+
Optional[List[WebElement]]: List of clickable WebElement objects, or None if none found.
|
|
445
|
+
"""
|
|
434
446
|
partial = kwargs["partial_match"]
|
|
447
|
+
|
|
448
|
+
# find parent <a> from slots with direct text
|
|
449
|
+
if partial:
|
|
450
|
+
xpath = f"//a[descendant::slot[contains(., '{locator}')]]"
|
|
451
|
+
else:
|
|
452
|
+
xpath = f"//a[descendant::slot[text()='{locator}']]"
|
|
453
|
+
|
|
454
|
+
# Find slots with text and get their parent link
|
|
455
|
+
driver = browser.get_current_browser()
|
|
456
|
+
xpath_elements = driver.find_elements(By.XPATH, xpath)
|
|
457
|
+
# Find normal elements via javascript
|
|
435
458
|
if shadow_dom:
|
|
436
|
-
|
|
437
|
-
javascript.get_clickable_from_shadow_dom(locator, partial)
|
|
438
|
-
)
|
|
459
|
+
js_elements = javascript.get_clickable_from_shadow_dom(locator, partial)
|
|
439
460
|
else:
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
461
|
+
js_elements = javascript.get_clickable(locator)
|
|
462
|
+
|
|
463
|
+
if js_elements:
|
|
464
|
+
logger.debug(f"Found elements by js: {js_elements}")
|
|
465
|
+
|
|
466
|
+
# merge found elements and check visibility
|
|
467
|
+
if not xpath_elements:
|
|
468
|
+
xpath_elements = []
|
|
469
|
+
else:
|
|
470
|
+
logger.debug(f"Found elements by xpath: {xpath_elements}")
|
|
471
|
+
if js_elements:
|
|
472
|
+
util.remove_duplicates_from_list(js_elements, xpath_elements)
|
|
473
|
+
# util.remove_stale_elements(xpath_elements)
|
|
474
|
+
if xpath_elements:
|
|
475
|
+
return element.get_visible_elements_from_elements(xpath_elements, **kwargs)
|
|
446
476
|
return None
|
|
447
477
|
|
|
448
478
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|