I need to remove all script nodes from a page before saving the body of the page. How can I remove all script nodes from a page?
You can do something like this:
await page.EvaluateExpressionAsync("document.querySelectorAll('SCRIPT').forEach(e => e.remove())");