I'm trying to get all the past revisions (edits) on a certain Wikipedia article using the MediaWIki API. This code should retrieve all the edits made on the FDR Wikipedia page. Here is the code that I wrote in order to do this:
import re
import requests
def GetRevisions():
url = "https://en.wikipedia.org/w/api.php?action=query=Franklin%20Delano%20Roosevelt=revisions&rvlimit=500&titles="
while True:
joan = requests.get(url)
revisions = []
revisions += re.findall('<continue rvcontinue="([^"]+)"',joan)
cont = re.search('<continue rvcontinue="([^"]+)"',joan)
if not cont:
break
return revisions
The problem that I keep running into is this error:
TypeError: expected string or buffer
`
I'm not sure why this error keeps on showing up.
Can anyone please give guidance on how to remedy this?