Automate browser based workflows with AI
Python aiapiautomationbrowserbrowser-automationcomputergptllmplaywrightpowerautomatepuppeteerpythonrpaseleniumvisionworkflow
handle parsing context exception (#877)
LawyZheng8a93c08d67c3
diff --git a/skyvern/webeye/scraper/domUtils.js b/skyvern/webeye/scraper/domUtils.jsindex 1caa0b6cb..83bd5a756 100644--- a/skyvern/webeye/scraper/domUtils.js+++ b/skyvern/webeye/scraper/domUtils.js@@ -1256,9 +1256,23 @@ function buildElementTree(starter = document.body, frame, full_tree = false) {}let ctxList = [];- ctxList = getContextByLinked(element, ctxList);- ctxList = getContextByParent(element, ctxList);- ctxList = getContextByTable(element, ctxList);+ try {+ ctxList = getContextByLinked(element, ctxList);+ } catch (e) {+ console.error("failed to get context by linked: ", e);+ }++ try {+ ctxList = getContextByParent(element, ctxList);+ } catch (e) {+ console.error("failed to get context by parent: ", e);+ }++ try {+ ctxList = getContextByTable(element, ctxList);+ } catch (e) {+ console.error("failed to get context by table: ", e);+ }const context = ctxList.join(";");if (context && context.length <= 5000) {element.context = context;