Skip to content

Commit

Permalink
fix(removeUnwantedElements): post-includeTags excludeTags
Browse files Browse the repository at this point in the history
Fixes #700
  • Loading branch information
mogery committed Jan 17, 2025
1 parent de08b37 commit faf58df
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions apps/api/src/scraper/scrapeURL/lib/removeUnwantedElements.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export const htmlTransform = (
url: string,
scrapeOptions: ScrapeOptions,
) => {
const soup = load(html);
let soup = load(html);

// remove unwanted elements
if (
Expand All @@ -68,7 +68,8 @@ export const htmlTransform = (
newRoot.append(soup(element).clone());
});
});
return newRoot.html() ?? "";

soup = load(newRoot.html() ?? "");
}

soup("script, style, noscript, meta, head").remove();
Expand Down

0 comments on commit faf58df

Please sign in to comment.