Skip to content

Automate browser based workflows with AI

Commit rapidand script, truncate dom element name length to max 500 characters (#1316)

Shuchang Zheng3b2e2de197e0
diff --git a/skyvern/webeye/scraper/scraper.py b/skyvern/webeye/scraper/scraper.py
index 975e5dfa8..788d0af8a 100644
--- a/skyvern/webeye/scraper/scraper.py
+++ b/skyvern/webeye/scraper/scraper.py
@@ -668,6 +668,13 @@ def trim_element(element: dict) -> dict:
if not element_text:
del queue_ele["text"]
+ if (
+ "attributes" in queue_ele
+ and "name" in queue_ele["attributes"]
+ and len(queue_ele["attributes"]["name"]) > 500
+ ):
+ queue_ele["attributes"]["name"] = queue_ele["attributes"]["name"][:500]
+
if "beforePseudoText" in queue_ele and not queue_ele.get("beforePseudoText"):
del queue_ele["beforePseudoText"]