Skip to content

Comment on Ask HN: How to remove Ads from a downloaded HTML file to output an ad free file?

Comments

Do you have to use Curl? It wouldn't render a lot of sites correctly anyway (anything that uses JS for rendering).

Can you run a puppeteer/playwright instance (which control real browsers) and add an ad blocker to that? e.g. https://github.com/ghostery/adblocker or https://github.com/microsoft/playwright-python/issues/782

I don't have to use curl, but in the past when I have setup something that opens browser instances it has usually been a bit unstable in the sense that it would crash intermittently.

I wanted something that I could kick-off as a daily cron job.

Hmm, can't you check for correctness somehow and retry on failure? Those headless browsers are often run in automated environments.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.