In the last years, I learned to love Pocket, a service that lets you manage a “read it later” list of articles that you can fill with pieces that interests you. It does a great job in offering a direct, simple and distraction-free experience while reading, and it is perfectly integrated with many devices and browsers, e-book readers included.

Talking about reading, The Economist is also one of my favorite weekly lectures since it is one of the few newspaper companies putting effort into producing quality content and avoiding click-bait for an honest monthly fee. That is why reading the weekly edition has become one of my favourite hobbies.

Recently, I wanted to put together these two points and export all the weekly articles from The Economist to my Pocket account, and that is where the struggle became real. There are more or less 70 articles every week to export. It would not be wise to do it recursively. Thus I figured out a way to batching the operation, and that is how it works.

The first step is trying to extract all the website links of the weekly articles. To do so, go to the weekly edition page (that should have a connection like that: https://www.economist.com/weeklyedition/…), make sure you are signed in, and open the developer’s tool of your browser. Go in the console section and type:

//Select all the CSS elements related to the head-link class that in the selected website correspond to links of all the articles

var links = document.getElementsByClassName("headline-link")

// Link is an HLML collector. In order to have them written in a text format, type the following

for (i = 0; i < links.length; i++) {console.log(links[i].href) }

You will get a list of all the articles in a text format that you can copy and paste. Note: that is javascript, a programming language using intensively on web pages, but for the scope of the article, there is no need to go deeper or let me know if you want to know more.

Now that the list of the links is available, the last step is using the Chrome Extension Batch Save Pocket to let you copy and paste all the links and add them to your Pocket list once you have already connected it to your account. A suggestion here would also be to use a tag #economist to keep your Pocket List organised.

And that’s it. You’re ready to enjoy The Economist on Pocket apps!

Leave a Reply

Your email address will not be published. Required fields are marked *