fix scraping failed (#509)
This commit is contained in:
@@ -865,10 +865,10 @@ async function buildTreeFromBody(frame = "main.frame", open_select = false) {
|
|||||||
let elementObj = null;
|
let elementObj = null;
|
||||||
if (element.tagName.toLowerCase() === "svg") {
|
if (element.tagName.toLowerCase() === "svg") {
|
||||||
// if element is <svg> we save all attributes and its children
|
// if element is <svg> we save all attributes and its children
|
||||||
elementObj = buildElementObject(element, false);
|
elementObj = await buildElementObject(element, false);
|
||||||
} else if (element.closest("svg")) {
|
} else if (element.closest("svg")) {
|
||||||
// if elemnet is the children of <svg>
|
// if elemnet is the children of <svg>
|
||||||
elementObj = buildElementObject(element, false);
|
elementObj = await buildElementObject(element, false);
|
||||||
} else {
|
} else {
|
||||||
// character length limit for non-interactable elements should be 5000
|
// character length limit for non-interactable elements should be 5000
|
||||||
// we don't use element context in HTML format,
|
// we don't use element context in HTML format,
|
||||||
@@ -881,7 +881,7 @@ async function buildTreeFromBody(frame = "main.frame", open_select = false) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (textContent && textContent.length <= 5000) {
|
if (textContent && textContent.length <= 5000) {
|
||||||
elementObj = buildElementObject(element, false);
|
elementObj = await buildElementObject(element, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user