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