This project is an envelope for simple fetching of historical versions of page from archive.org API.
The page can be used for subsequent webscraping
Install from pip with
pip install waybackmachineTo fetch the latest version from archive, simply use fetch() function.
import waybackmachine as wm
url = "https://en.wikipedia.org/wiki/COVID-19"
latest = wm.fetch(url)
latest.response # requests.Response
latest.date # capture time
latest.url # urlOptionally you can specify date. The first version after this date is chosen.
may2020 = wm.fetch(url, date="2020-05-01")You can also iterate archived versions backwards in time.
for version in wm.browse(url):
version.response # requests.Response
version.date # capture time
version.url # urlThis will iterate the screenshots from archive.org.
You can specify a custom date range as follows.
for version in wm.browse(url, start='2020-06-30', end='2020-03-01'):
passDeveloped by Martin Benes.
Join on GitHub.