parsagon 0.14.7__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.7 → parsagon-0.14.9}/PKG-INFO +1 -1
- {parsagon-0.14.7 → parsagon-0.14.9}/pyproject.toml +1 -1
- {parsagon-0.14.7 → parsagon-0.14.9}/src/parsagon/executor.py +15 -3
- {parsagon-0.14.7 → parsagon-0.14.9}/src/parsagon.egg-info/PKG-INFO +1 -1
- {parsagon-0.14.7 → parsagon-0.14.9}/README.md +0 -0
- {parsagon-0.14.7 → parsagon-0.14.9}/setup.cfg +0 -0
- {parsagon-0.14.7 → parsagon-0.14.9}/src/__init__.py +0 -0
- {parsagon-0.14.7 → parsagon-0.14.9}/src/parsagon/__init__.py +0 -0
- {parsagon-0.14.7 → parsagon-0.14.9}/src/parsagon/api.py +0 -0
- {parsagon-0.14.7 → parsagon-0.14.9}/src/parsagon/assistant.py +0 -0
- {parsagon-0.14.7 → parsagon-0.14.9}/src/parsagon/create.py +0 -0
- {parsagon-0.14.7 → parsagon-0.14.9}/src/parsagon/custom_function.py +0 -0
- {parsagon-0.14.7 → parsagon-0.14.9}/src/parsagon/edit.py +0 -0
- {parsagon-0.14.7 → parsagon-0.14.9}/src/parsagon/exceptions.py +0 -0
- {parsagon-0.14.7 → parsagon-0.14.9}/src/parsagon/gui/__init__.py +0 -0
- {parsagon-0.14.7 → parsagon-0.14.9}/src/parsagon/gui/controller.py +0 -0
- {parsagon-0.14.7 → parsagon-0.14.9}/src/parsagon/gui/menu.py +0 -0
- {parsagon-0.14.7 → parsagon-0.14.9}/src/parsagon/gui/window.py +0 -0
- {parsagon-0.14.7 → parsagon-0.14.9}/src/parsagon/gui_entry.py +0 -0
- {parsagon-0.14.7 → parsagon-0.14.9}/src/parsagon/highlights.js +0 -0
- {parsagon-0.14.7 → parsagon-0.14.9}/src/parsagon/main.py +0 -0
- {parsagon-0.14.7 → parsagon-0.14.9}/src/parsagon/print.py +0 -0
- {parsagon-0.14.7 → parsagon-0.14.9}/src/parsagon/runs.py +0 -0
- {parsagon-0.14.7 → parsagon-0.14.9}/src/parsagon/secrets.py +0 -0
- {parsagon-0.14.7 → parsagon-0.14.9}/src/parsagon/settings.py +0 -0
- {parsagon-0.14.7 → parsagon-0.14.9}/src/parsagon/tests/__init__.py +0 -0
- {parsagon-0.14.7 → parsagon-0.14.9}/src/parsagon/tests/api_mocks.py +0 -0
- {parsagon-0.14.7 → parsagon-0.14.9}/src/parsagon/tests/conftest.py +0 -0
- {parsagon-0.14.7 → parsagon-0.14.9}/src/parsagon/tests/test_executor.py +0 -0
- {parsagon-0.14.7 → parsagon-0.14.9}/src/parsagon/tests/test_invalid_args.py +0 -0
- {parsagon-0.14.7 → parsagon-0.14.9}/src/parsagon/tests/test_pipeline_operations.py +0 -0
- {parsagon-0.14.7 → parsagon-0.14.9}/src/parsagon/tests/test_print.py +0 -0
- {parsagon-0.14.7 → parsagon-0.14.9}/src/parsagon/tests/test_secrets.py +0 -0
- {parsagon-0.14.7 → parsagon-0.14.9}/src/parsagon.egg-info/SOURCES.txt +0 -0
- {parsagon-0.14.7 → parsagon-0.14.9}/src/parsagon.egg-info/dependency_links.txt +0 -0
- {parsagon-0.14.7 → parsagon-0.14.9}/src/parsagon.egg-info/entry_points.txt +0 -0
- {parsagon-0.14.7 → parsagon-0.14.9}/src/parsagon.egg-info/requires.txt +0 -0
- {parsagon-0.14.7 → parsagon-0.14.9}/src/parsagon.egg-info/top_level.txt +0 -0
@@ -212,24 +212,36 @@ 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
|
-
"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'))"
|
218
223
|
)
|
219
224
|
)
|
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
|
-
|
228
|
+
elem_id = str(elem_id)
|
229
|
+
is_visible = elem_id in visible_elem_ids
|
224
230
|
if not is_visible:
|
225
231
|
try:
|
226
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
|
227
240
|
parent = lxml_elem.getparent()
|
228
241
|
if parent is not None:
|
229
242
|
parent.remove(lxml_elem)
|
230
243
|
except IndexError:
|
231
244
|
continue
|
232
|
-
|
233
245
|
return lxml.html.tostring(root).decode()
|
234
246
|
|
235
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
|