parsagon 0.14.6__tar.gz → 0.14.8__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.6 → parsagon-0.14.8}/PKG-INFO +1 -1
- {parsagon-0.14.6 → parsagon-0.14.8}/pyproject.toml +1 -1
- {parsagon-0.14.6 → parsagon-0.14.8}/src/parsagon/executor.py +9 -17
- {parsagon-0.14.6 → parsagon-0.14.8}/src/parsagon.egg-info/PKG-INFO +1 -1
- {parsagon-0.14.6 → parsagon-0.14.8}/README.md +0 -0
- {parsagon-0.14.6 → parsagon-0.14.8}/setup.cfg +0 -0
- {parsagon-0.14.6 → parsagon-0.14.8}/src/__init__.py +0 -0
- {parsagon-0.14.6 → parsagon-0.14.8}/src/parsagon/__init__.py +0 -0
- {parsagon-0.14.6 → parsagon-0.14.8}/src/parsagon/api.py +0 -0
- {parsagon-0.14.6 → parsagon-0.14.8}/src/parsagon/assistant.py +0 -0
- {parsagon-0.14.6 → parsagon-0.14.8}/src/parsagon/create.py +0 -0
- {parsagon-0.14.6 → parsagon-0.14.8}/src/parsagon/custom_function.py +0 -0
- {parsagon-0.14.6 → parsagon-0.14.8}/src/parsagon/edit.py +0 -0
- {parsagon-0.14.6 → parsagon-0.14.8}/src/parsagon/exceptions.py +0 -0
- {parsagon-0.14.6 → parsagon-0.14.8}/src/parsagon/gui/__init__.py +0 -0
- {parsagon-0.14.6 → parsagon-0.14.8}/src/parsagon/gui/controller.py +0 -0
- {parsagon-0.14.6 → parsagon-0.14.8}/src/parsagon/gui/menu.py +0 -0
- {parsagon-0.14.6 → parsagon-0.14.8}/src/parsagon/gui/window.py +0 -0
- {parsagon-0.14.6 → parsagon-0.14.8}/src/parsagon/gui_entry.py +0 -0
- {parsagon-0.14.6 → parsagon-0.14.8}/src/parsagon/highlights.js +0 -0
- {parsagon-0.14.6 → parsagon-0.14.8}/src/parsagon/main.py +0 -0
- {parsagon-0.14.6 → parsagon-0.14.8}/src/parsagon/print.py +0 -0
- {parsagon-0.14.6 → parsagon-0.14.8}/src/parsagon/runs.py +0 -0
- {parsagon-0.14.6 → parsagon-0.14.8}/src/parsagon/secrets.py +0 -0
- {parsagon-0.14.6 → parsagon-0.14.8}/src/parsagon/settings.py +0 -0
- {parsagon-0.14.6 → parsagon-0.14.8}/src/parsagon/tests/__init__.py +0 -0
- {parsagon-0.14.6 → parsagon-0.14.8}/src/parsagon/tests/api_mocks.py +0 -0
- {parsagon-0.14.6 → parsagon-0.14.8}/src/parsagon/tests/conftest.py +0 -0
- {parsagon-0.14.6 → parsagon-0.14.8}/src/parsagon/tests/test_executor.py +0 -0
- {parsagon-0.14.6 → parsagon-0.14.8}/src/parsagon/tests/test_invalid_args.py +0 -0
- {parsagon-0.14.6 → parsagon-0.14.8}/src/parsagon/tests/test_pipeline_operations.py +0 -0
- {parsagon-0.14.6 → parsagon-0.14.8}/src/parsagon/tests/test_print.py +0 -0
- {parsagon-0.14.6 → parsagon-0.14.8}/src/parsagon/tests/test_secrets.py +0 -0
- {parsagon-0.14.6 → parsagon-0.14.8}/src/parsagon.egg-info/SOURCES.txt +0 -0
- {parsagon-0.14.6 → parsagon-0.14.8}/src/parsagon.egg-info/dependency_links.txt +0 -0
- {parsagon-0.14.6 → parsagon-0.14.8}/src/parsagon.egg-info/entry_points.txt +0 -0
- {parsagon-0.14.6 → parsagon-0.14.8}/src/parsagon.egg-info/requires.txt +0 -0
- {parsagon-0.14.6 → parsagon-0.14.8}/src/parsagon.egg-info/top_level.txt +0 -0
@@ -215,30 +215,22 @@ class Executor:
|
|
215
215
|
id_to_elem = {}
|
216
216
|
for elem in root.iter():
|
217
217
|
elem_id = elem.get("data-psgn-id")
|
218
|
-
if elem_id
|
218
|
+
if elem_id:
|
219
219
|
id_to_elem[elem_id] = elem
|
220
|
-
visible_elem_ids =
|
221
|
-
|
220
|
+
visible_elem_ids = set(
|
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'))"
|
223
|
+
)
|
222
224
|
)
|
223
|
-
visible_elems = set()
|
224
|
-
for elem_id in visible_elem_ids[::-1]:
|
225
|
-
elem = id_to_elem[elem_id]
|
226
|
-
if elem in visible_elems:
|
227
|
-
continue
|
228
|
-
visible_elems.add(elem)
|
229
|
-
# visible_elems.update(elem.iterancestors())
|
230
225
|
max_elem_id = self.max_elem_ids[self.driver.current_window_handle]
|
231
226
|
with Progress() as progress:
|
232
227
|
for elem_id in progress.track(range(max_elem_id), description="[green]Analyzing page"):
|
233
228
|
elem_id = str(elem_id)
|
234
|
-
if elem_id not in
|
235
|
-
|
236
|
-
|
237
|
-
is_visible = elem in visible_elems
|
238
|
-
if not is_visible:
|
239
|
-
parent = elem.getparent()
|
229
|
+
if elem_id in id_to_elem and elem_id not in visible_elem_ids:
|
230
|
+
lxml_elem = id_to_elem[elem_id]
|
231
|
+
parent = lxml_elem.getparent()
|
240
232
|
if parent is not None:
|
241
|
-
parent.remove(
|
233
|
+
parent.remove(lxml_elem)
|
242
234
|
|
243
235
|
return lxml.html.tostring(root).decode()
|
244
236
|
|
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
|