feat: edit ui + add return html option (#90)

* fix: restyle the element table

* chore: wip ui

* wip: edit styles

* feat: add html return

* fix: build

* fix: workflow

* fix: workflow

* fix: workflow

* fix: workflow

* fix: workflow

* fix: workflow

* fix: workflow

* fix: cypress test

* chore: update photo [skip ci]
This commit is contained in:
Jayden Pyles
2025-06-08 18:14:02 -05:00
committed by GitHub
parent 02619eb184
commit 20dccc5527
25 changed files with 633 additions and 288 deletions

View File

@@ -206,7 +206,7 @@ def parse_next_page(text: str) -> str | None:
async def capture_elements(
page: Page, xpaths: list[dict[str, str]]
page: Page, xpaths: list[dict[str, str]], return_html: bool
) -> list[CapturedElement]:
captured_elements = []
seen_texts = set()
@@ -217,6 +217,23 @@ async def capture_elements(
count = await locator.count()
for i in range(count):
if return_html:
element_text = (
await page.locator(f"xpath={xpath['xpath']}")
.nth(i)
.inner_html()
)
seen_texts.add(element_text)
captured_elements.append(
CapturedElement(
name=xpath["name"],
text=element_text,
xpath=xpath["xpath"],
)
)
continue
element_text = ""
element_handle = await locator.nth(i).element_handle()