Skip to content

Instantly share code, notes, and snippets.

@MartinWeiss12
Created November 18, 2024 15:22
Show Gist options
  • Save MartinWeiss12/c3278cf8b3e9e75eec241e64048677fc to your computer and use it in GitHub Desktop.
Save MartinWeiss12/c3278cf8b3e9e75eec241e64048677fc to your computer and use it in GitHub Desktop.
Download Top Images
def download_images(folder, type):
top_49 = folder[f'{type} Image URL'][:49]
folder_path = os.path.abspath(f'{type}-Images')
for i, url in enumerate(top_49):
with open(os.path.join(folder_path, f'{type}-{i+1}.png'), 'wb') as file:
file.write(requests.get(url).content)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment