Skip to content

Instantly share code, notes, and snippets.

@garrettdashnelson
Created September 11, 2019 12:55
Show Gist options
  • Save garrettdashnelson/b2f1569ed1789933f68ebf5f1c203368 to your computer and use it in GitHub Desktop.
Save garrettdashnelson/b2f1569ed1789933f68ebf5f1c203368 to your computer and use it in GitHub Desktop.
import requests
from bs4 import BeautifulSoup
barcode = "39999059010775"
r = requests.get('https://collections.leventhalmap.org/search?page=1&per_page=100&q={}'.format(barcode))
htmlSource = BeautifulSoup(r.text, "html.parser")
for d in htmlSource.find_all("div", class_="document"):
dcId = d["data-layer-id"]
tiffUrl = "https://collections.leventhalmap.org/start_download/{}?datastream_id=productionMaster".format(dcId)
print(tiffUrl)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment