parsagon 0.14.8__tar.gz → 0.14.9__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.
- {parsagon-0.14.8 → parsagon-0.14.9}/PKG-INFO +1 -1
- {parsagon-0.14.8 → parsagon-0.14.9}/pyproject.toml +1 -1
- {parsagon-0.14.8 → parsagon-0.14.9}/src/parsagon/executor.py +17 -7
- {parsagon-0.14.8 → parsagon-0.14.9}/src/parsagon.egg-info/PKG-INFO +1 -1
- {parsagon-0.14.8 → parsagon-0.14.9}/README.md +0 -0
- {parsagon-0.14.8 → parsagon-0.14.9}/setup.cfg +0 -0
- {parsagon-0.14.8 → parsagon-0.14.9}/src/__init__.py +0 -0
- {parsagon-0.14.8 → parsagon-0.14.9}/src/parsagon/__init__.py +0 -0
- {parsagon-0.14.8 → parsagon-0.14.9}/src/parsagon/api.py +0 -0
- {parsagon-0.14.8 → parsagon-0.14.9}/src/parsagon/assistant.py +0 -0
- {parsagon-0.14.8 → parsagon-0.14.9}/src/parsagon/create.py +0 -0
- {parsagon-0.14.8 → parsagon-0.14.9}/src/parsagon/custom_function.py +0 -0
- {parsagon-0.14.8 → parsagon-0.14.9}/src/parsagon/edit.py +0 -0
- {parsagon-0.14.8 → parsagon-0.14.9}/src/parsagon/exceptions.py +0 -0
- {parsagon-0.14.8 → parsagon-0.14.9}/src/parsagon/gui/__init__.py +0 -0
- {parsagon-0.14.8 → parsagon-0.14.9}/src/parsagon/gui/controller.py +0 -0
- {parsagon-0.14.8 → parsagon-0.14.9}/src/parsagon/gui/menu.py +0 -0
- {parsagon-0.14.8 → parsagon-0.14.9}/src/parsagon/gui/window.py +0 -0
- {parsagon-0.14.8 → parsagon-0.14.9}/src/parsagon/gui_entry.py +0 -0
- {parsagon-0.14.8 → parsagon-0.14.9}/src/parsagon/highlights.js +0 -0
- {parsagon-0.14.8 → parsagon-0.14.9}/src/parsagon/main.py +0 -0
- {parsagon-0.14.8 → parsagon-0.14.9}/src/parsagon/print.py +0 -0
- {parsagon-0.14.8 → parsagon-0.14.9}/src/parsagon/runs.py +0 -0
- {parsagon-0.14.8 → parsagon-0.14.9}/src/parsagon/secrets.py +0 -0
- {parsagon-0.14.8 → parsagon-0.14.9}/src/parsagon/settings.py +0 -0
- {parsagon-0.14.8 → parsagon-0.14.9}/src/parsagon/tests/__init__.py +0 -0
- {parsagon-0.14.8 → parsagon-0.14.9}/src/parsagon/tests/api_mocks.py +0 -0
- {parsagon-0.14.8 → parsagon-0.14.9}/src/parsagon/tests/conftest.py +0 -0
- {parsagon-0.14.8 → parsagon-0.14.9}/src/parsagon/tests/test_executor.py +0 -0
- {parsagon-0.14.8 → parsagon-0.14.9}/src/parsagon/tests/test_invalid_args.py +0 -0
- {parsagon-0.14.8 → parsagon-0.14.9}/src/parsagon/tests/test_pipeline_operations.py +0 -0
- {parsagon-0.14.8 → parsagon-0.14.9}/src/parsagon/tests/test_print.py +0 -0
- {parsagon-0.14.8 → parsagon-0.14.9}/src/parsagon/tests/test_secrets.py +0 -0
- {parsagon-0.14.8 → parsagon-0.14.9}/src/parsagon.egg-info/SOURCES.txt +0 -0
- {parsagon-0.14.8 → parsagon-0.14.9}/src/parsagon.egg-info/dependency_links.txt +0 -0
- {parsagon-0.14.8 → parsagon-0.14.9}/src/parsagon.egg-info/entry_points.txt +0 -0
- {parsagon-0.14.8 → parsagon-0.14.9}/src/parsagon.egg-info/requires.txt +0 -0
- {parsagon-0.14.8 → parsagon-0.14.9}/src/parsagon.egg-info/top_level.txt +0 -0
@@ -219,19 +219,29 @@ class Executor:
|
|
219
219
|
id_to_elem[elem_id] = elem
|
220
220
|
visible_elem_ids = set(
|
221
221
|
driver.execute_script(
|
222
|
-
"return Array.from(document.getElementsByTagName('*')).filter((elem) => { const style = getComputedStyle(elem); return style.opacity > 0.1 && style.display !== 'none' && style.visibility === 'visible' && elem.offsetWidth && elem.offsetHeight && elem.getClientRects().length }).map((elem) => elem.getAttribute('data-psgn-id'))"
|
222
|
+
"return Array.from(document.getElementsByTagName('*')).filter((elem) => { const style = getComputedStyle(elem); const rect = elem.getBoundingClientRect(); return style.opacity > 0.1 && style.display !== 'none' && style.visibility === 'visible' && elem.offsetWidth && elem.offsetHeight && elem.getClientRects().length && rect.right + window.scrollX >= 0 && rect.bottom + window.scrollY >= 0 }).map((elem) => elem.getAttribute('data-psgn-id'))"
|
223
223
|
)
|
224
224
|
)
|
225
225
|
max_elem_id = self.max_elem_ids[self.driver.current_window_handle]
|
226
226
|
with Progress() as progress:
|
227
227
|
for elem_id in progress.track(range(max_elem_id), description="[green]Analyzing page"):
|
228
228
|
elem_id = str(elem_id)
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
229
|
+
is_visible = elem_id in visible_elem_ids
|
230
|
+
if not is_visible:
|
231
|
+
try:
|
232
|
+
lxml_elem = root.xpath(f'//*[@data-psgn-id="{elem_id}"]')[0]
|
233
|
+
contains_visible = False
|
234
|
+
for descendant in lxml_elem.iterdescendants():
|
235
|
+
if descendant.get("data-psgn-id") in visible_elem_ids:
|
236
|
+
contains_visible = True
|
237
|
+
break
|
238
|
+
if contains_visible:
|
239
|
+
continue
|
240
|
+
parent = lxml_elem.getparent()
|
241
|
+
if parent is not None:
|
242
|
+
parent.remove(lxml_elem)
|
243
|
+
except IndexError:
|
244
|
+
continue
|
235
245
|
return lxml.html.tostring(root).decode()
|
236
246
|
|
237
247
|
def get_elem(self, description, elem_type):
|
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
|