mirror of
https://github.com/Skyvern-AI/skyvern.git
synced 2025-09-01 18:20:06 +00:00
DomUtil optimize (#350)
This commit is contained in:
parent
0719396136
commit
f86097fc78
1 changed files with 6 additions and 3 deletions
|
@ -758,8 +758,10 @@ function buildTreeFromBody() {
|
|||
}
|
||||
}
|
||||
|
||||
// character length limit for non-interactable elements should be 100
|
||||
if (textContent && textContent.length <= 100) {
|
||||
// character length limit for non-interactable elements should be 5000
|
||||
// we don't use element context in HTML format,
|
||||
// so we need to make sure we parse all text node to avoid missing text in HTML.
|
||||
if (textContent && textContent.length <= 5000) {
|
||||
var elementObj = buildElementObject(element, false);
|
||||
elements.push(elementObj);
|
||||
if (parentId === null) {
|
||||
|
@ -991,7 +993,8 @@ function buildTreeFromBody() {
|
|||
element.context = context;
|
||||
}
|
||||
|
||||
if (checkStringIncludeRequire(context)) {
|
||||
// FIXME: skip <a> for now to prevent navigating to other page by mistake
|
||||
if (element.tagName !== "a" && checkStringIncludeRequire(context)) {
|
||||
if (
|
||||
!element.attributes["required"] &&
|
||||
!element.attributes["aria-required"]
|
||||
|
|
Loading…
Add table
Reference in a new issue