-
-
Save shanirub/45ac2c0bfe5cca7929892eafd200d3e9 to your computer and use it in GitHub Desktop.
yad_vashem_scrape
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import shutil | |
image_path = 'http://namesfs.yadvashem.org/documentation4/16/12587775_03289775/' | |
path_to_save = '/Users/<USER_NAME>/Downloads/' | |
number_of_images = 51 | |
for i in range(number_of_images): | |
image_name = str(i+1).zfill(5) + '.JPG' | |
resp = requests.get(image_path+image_name, stream=True) | |
with open(path_to_save + image_name, 'wb') as f: | |
resp.raw.decode_content = True | |
shutil.copyfileobj(resp.raw, f) | |
print('Saved ' + image_name) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment