refactor select handler (#565)

This commit is contained in:
LawyZheng
2024-07-09 02:22:16 +08:00
committed by GitHub
parent 7a75bb3741
commit bcbd738326
4 changed files with 309 additions and 113 deletions

View File

@@ -324,6 +324,12 @@ async def get_select2_options(frame: Page | Frame, element: ElementHandle) -> li
return await frame.evaluate(js_script, element)
async def get_combobox_options(frame: Page | Frame, element: ElementHandle) -> list[dict[str, Any]]:
await frame.evaluate(JS_FUNCTION_DEFS)
js_script = "async (element) => await getListboxOptions(element)"
return await frame.evaluate(js_script, element)
async def get_interactable_element_tree_in_frame(
frames: list[Frame],
elements: list[dict],