Skip to content

Automate browser based workflows with AI

fix null element execption (#370)

LawyZheng1b2077facdab
diff --git a/skyvern/webeye/scraper/domUtils.js b/skyvern/webeye/scraper/domUtils.js
index 158e073b3..7533d9d16 100644
--- a/skyvern/webeye/scraper/domUtils.js
+++ b/skyvern/webeye/scraper/domUtils.js
@@ -714,6 +714,11 @@ function buildTreeFromBody() {
}
}
function processElement(element, parentId) {
+ if (element === null) {
+ console.log("get a null element");
+ return;
+ }
+
// Check if the element is interactable
if (isInteractable(element)) {
var elementObj = buildElementObject(element, true);