Automate browser based workflows with AI
Python aiapiautomationbrowserbrowser-automationcomputergptllmplaywrightpowerautomatepuppeteerpythonrpaseleniumvisionworkflow
use value of the optiona when the content is empty (#4035)
LawyZheng31a79a131352
diff --git a/skyvern/webeye/scraper/domUtils.js b/skyvern/webeye/scraper/domUtils.jsindex 5f5588d8c..9edc77919 100644--- a/skyvern/webeye/scraper/domUtils.js+++ b/skyvern/webeye/scraper/domUtils.js@@ -1380,6 +1380,7 @@ function getSelectOptions(element) {selectOptions.push({optionIndex: option.index,text: removeMultipleSpaces(option.textContent),+ value: removeMultipleSpaces(option.value),});}diff --git a/skyvern/webeye/scraper/scraper.py b/skyvern/webeye/scraper/scraper.pyindex 329c2fe7a..e59904ac9 100644--- a/skyvern/webeye/scraper/scraper.py+++ b/skyvern/webeye/scraper/scraper.py@@ -152,6 +152,8 @@ def json_to_html(element: dict, need_skyvern_attrs: bool = True) -> str:# build option HTMLoption_html = "".join(f'<option index="{option.get("optionIndex")}">{option.get("text")}</option>'+ if option.get("text")+ else f'<option index="{option.get("optionIndex")}" value="{option.get("value")}">{option.get("text")}</option>'for option in element.get("options", []))diff --git a/skyvern/webeye/utils/dom.py b/skyvern/webeye/utils/dom.pyindex e7070f93a..0552ce7e6 100644--- a/skyvern/webeye/utils/dom.py+++ b/skyvern/webeye/utils/dom.py@@ -85,6 +85,7 @@ RAW_INPUT_NAME_VALUE = ["name", "email", "username", "password", "phone"]class SkyvernOptionType(typing.TypedDict):optionIndex: inttext: str+ value: strclass SkyvernElement: