Automate browser based workflows with AI
Python aiapiautomationbrowserbrowser-automationcomputergptllmplaywrightpowerautomatepuppeteerpythonrpaseleniumvisionworkflow
enhance checkbox detecting (#1840)
Shuchang Zheng9b9c84f7dc67
diff --git a/skyvern/webeye/scraper/domUtils.js b/skyvern/webeye/scraper/domUtils.jsindex 79134c00b..6d19abb91 100644--- a/skyvern/webeye/scraper/domUtils.js+++ b/skyvern/webeye/scraper/domUtils.js@@ -799,6 +799,21 @@ function isDatePickerSelector(element) {return false;}+function isCheckableDiv(element) {+ const tagName = element.tagName.toLowerCase();+ if (tagName !== "div") {+ return false;+ }+ if (+ element.className &&+ element.className.toString().includes("checkbox") &&+ element.childElementCount === 0+ ) {+ return true;+ }+ return false;+}+const isComboboxDropdown = (element) => {if (element.tagName.toLowerCase() !== "input") {return false;@@ -1300,6 +1315,7 @@ async function buildElementObject(isAngularDropdown(element) ||isSelect2Dropdown(element) ||isSelect2MultiChoice(element),+ isCheckable: isCheckableDiv(element),};let isInShadowRoot = element.getRootNode() instanceof ShadowRoot;diff --git a/skyvern/webeye/scraper/scraper.py b/skyvern/webeye/scraper/scraper.pyindex e3ac244df..8e319fd1e 100644--- a/skyvern/webeye/scraper/scraper.py+++ b/skyvern/webeye/scraper/scraper.py@@ -100,6 +100,10 @@ def json_to_html(element: dict, need_skyvern_attrs: bool = True) -> str:tag = element["tagName"]attributes: dict[str, Any] = copy.deepcopy(element.get("attributes", {}))+ if element.get("isCheckable", False) and tag != "input":+ tag = "input"+ attributes["type"] = "checkbox"+context = skyvern_context.ensure_context()# FIXME: Theoretically, all href links with over 69(64+1+4) length could be hashed