Because I hate clicking forth and back reading through Wikipedia articles I am trying to build a tool to create "expanded Wikipedia articles" according to the following algorithm:
- Create two variables:
Depth
andLength
. - Set a Wikipedia article as a seed page
- Parse through this article: Whenever there is a link to another article fetch the first
Length
sentences and include it in the original article (e.g. in brackets or otherwise highlighted). - Do this recursively up to a certain
Depth
, i.e. not deeper than two levels.
The result would be an article that could be read in one go without always clicking to and fro...
How would you build such a mechanism in Python? Which libraries should be used (are there any for such tasks)? Are there any helpful tutorials?