mirror of
https://git.mirrors.martin98.com/https://github.com/mendableai/firecrawl
synced 2025-08-14 00:25:57 +08:00
parent
de08b37480
commit
faf58dfca7
@ -54,7 +54,7 @@ export const htmlTransform = (
|
|||||||
url: string,
|
url: string,
|
||||||
scrapeOptions: ScrapeOptions,
|
scrapeOptions: ScrapeOptions,
|
||||||
) => {
|
) => {
|
||||||
const soup = load(html);
|
let soup = load(html);
|
||||||
|
|
||||||
// remove unwanted elements
|
// remove unwanted elements
|
||||||
if (
|
if (
|
||||||
@ -68,7 +68,8 @@ export const htmlTransform = (
|
|||||||
newRoot.append(soup(element).clone());
|
newRoot.append(soup(element).clone());
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
return newRoot.html() ?? "";
|
|
||||||
|
soup = load(newRoot.html() ?? "");
|
||||||
}
|
}
|
||||||
|
|
||||||
soup("script, style, noscript, meta, head").remove();
|
soup("script, style, noscript, meta, head").remove();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user