DEV Community

loading...

Circumventing news article blockers

Lizard
Mathematician
Updated on ・1 min read

I wanted to read this article: https://www.ocregister.com/2015/03/20/match-day-reveals-future-for-graduating-uc-irvine-medical-students/

But since I had my adblocker on I could not read the article. I could have turned of my adblocker to read the article but for other websites it is not so easy.

Sometimes you have to have a subscription in order to read the article. Usually I try to delete the popup box using inspect element. But some news articles blur out the text when you get the popup making it impossible to read the article even after deleting the popup. I found a neat way of being able to read such an article.

Upon requesting a webpage, such articles always seem to be loaded correctly but then quickly you get a popup, text blurs etc, etc. So I thought about downloading the html source code with curl and storing it in an html document. Then you open the file and voila. It worked and this is now one of the ways I read news articles for free if I really want to.

Here's a simple python script for it (for windows).

import os
import webbrowser

url = input("Link to article: ")
os.system(f"curl {url} > temp.html")
webbrowser.open('file://' + os.path.realpath("temp.html"))
Enter fullscreen mode Exit fullscreen mode

Discussion (0)