Skip to content

Instantly share code, notes, and snippets.

View Lachezar14's full-sized avatar

Lachezar Mitov Lachezar14

View GitHub Profile
@macloo
macloo / download_images.py
Last active November 16, 2023 15:58
Use Wikipedia API to download the main image for a page
"""
Find the main image on a Wikipedia page and download it.
Using a list of Wikipedia URLs, download the main image from each page in the list.
Name the downloaded file to match the page URL.
"""
import requests, os
# set the folder name where images will be stored
my_folder = 'wiki_images'