Last active
September 7, 2019 20:07
-
-
Save abhay-kum/6cb7e9ea314280ea1b5359d8d31a0c97 to your computer and use it in GitHub Desktop.
This file contains 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 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