Wolfe
Wolfe

Reputation: 21

How to use wikipedia API to parse through a list of links and retrieve data from them?

I have a wikipedia page that contains links (http://en.wikipedia.org/wiki/Lists_of_countries_and_territories). I want to go through all of those links that then retrieve the list of countries that are listed.

I have been able to retrieve all the links with BeautifulSoup and could just go through the links and use beautifulsoup to do it, but I want to use this scraper for various things and was wondering if there was a way to do this more easily and faster with the wikipedia API.

Upvotes: 2

Views: 1648

Answers (1)

Intracer
Intracer

Reputation: 3069

https://www.mediawiki.org/wiki/API:Links gets a list of all links on the provided pages. you can use this list as generator to retrieve the listed page properties, There are also client libraries

Upvotes: 2

Related Questions