Skip to content

Instantly share code, notes, and snippets.

@yanissi
Last active August 4, 2021 17:32
Show Gist options
  • Save yanissi/8cf11a2caae9ac24029219590d338b5b to your computer and use it in GitHub Desktop.
Save yanissi/8cf11a2caae9ac24029219590d338b5b to your computer and use it in GitHub Desktop.
## Fixed Height Export
import requests
import urllib.request
token = "9HGDNG5-50E40Y9-MRTE5HC-HRWHPPB"
url = "https://www.dailymail.co.uk/news/article-9744405/Melbourne-best-city-working-home-Covid-losing-crown-liveable-city.html"
result = requests.get(f"https://shot.screenshotapi.net/screenshot?token={token}&url={url}&height=3000&output=json&no_cookie_banners=true&block_ads=true")
urllib.request.urlretrieve(result.json()['screenshot'], "local-filename.png")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment