Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Download top500 favicons from csv
import requests
import pandas as pd
import os
from io import StringIO
def request_function(domain):
domain = domain.replace('/','')
url = '' + domain
fav = requests.get(url).content
with open('images'+os.sep+domain+'.png', 'wb') as handler:
# top 500 websites from mozilla
url = ""
headers = {"User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:66.0) Gecko/20100101 Firefox/66.0"}
req = requests.get(url, headers=headers)
data = StringIO(req.text)
df = pd.read_csv(data)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment