Skip to content

Instantly share code, notes, and snippets.

@abhay-kum
Last active September 7, 2019 20:07
Show Gist options
  • Save abhay-kum/6cb7e9ea314280ea1b5359d8d31a0c97 to your computer and use it in GitHub Desktop.
Save abhay-kum/6cb7e9ea314280ea1b5359d8d31a0c97 to your computer and use it in GitHub Desktop.
import requests
import os
from datetime import datetime
# url for capturing snapshots
api_url = "https://urlscan.io/liveshot/"
capture_url = "https://www.medium.com/"
height = "6000"
width = "2048"
params = {"width": width, "height": height, "url":capture_url}
res = requests.get(api_url, params= params)
if not os.path.exists('data/'):
os.mkdir("data/")
image_file_path = "data/medium_" + datetime.strftime(datetime.now(),'%Y_%m_%d') + ".png"
with open(image_file_path,'wb') as f:
# f.write(res.text.encode('utf-8'))
f.write(res.content)
print("snap taken for today")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment