Reputation: 21
I'm working through WMF Labs and using the Wikipedia API to parse out all the page links from a specific page in German then go back and find the english equivalent. My code only works for batches of 5 or less. If I try to run a larger batch like 10 or 15, some of the links that I KNOW have an english equivalent (good old fashioned search, also they show up in the <5 batches) throwback "None" as the english equivalent. Why do all links only work in batches of less than 5?
Here is a link to my code.
https://github.com/empo0270/Interlanguage-links-Wiki/blob/master/translateOutlinks.py
Upvotes: 0
Views: 97
Reputation: 94794
The API returns a maximum number of links per query, in this case 500 due to the lllimit=500
in your request. To get the remaining links, you have to follow the instructions for continuing queries to submit additional requests.
Since you're using python, you might want to consider using pywikibot which handles many of these details for you.
Upvotes: 1