Skip to content

Instantly share code, notes, and snippets.

@yanissi
Created August 3, 2021 23:37
Show Gist options
  • Save yanissi/8f60fc2dbc6ad6ec86a0956372136e5c to your computer and use it in GitHub Desktop.
Save yanissi/8f60fc2dbc6ad6ec86a0956372136e5c to your computer and use it in GitHub Desktop.
import pandas as pd
import time
import re
from slugify import slugify
from html2image import Html2Image
hti = Html2Image()
df = pd.read_csv("clippings.csv")
for clipping in df.itertuples():
clipping = clipping[1]
fileName = slugify(clipping).replace("-html","").replace("www-","").replace("https-","")
output = hti.screenshot(url=clipping,save_as=f"{fileName}.png")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment