Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在保存页面正文之前,我需要从页面中删除所有脚本节点。如何从页面中删除所有脚本节点?
你可以这样做:
await page.EvaluateExpressionAsync("document.querySelectorAll('SCRIPT').forEach(e => e.remove())");