Skip to content

Instantly share code, notes, and snippets.

@hirawatt
Created July 4, 2022 18:22
Show Gist options
  • Save hirawatt/c9ec050fbbbe7463b454ab7a4709a6c1 to your computer and use it in GitHub Desktop.
Save hirawatt/c9ec050fbbbe7463b454ab7a4709a6c1 to your computer and use it in GitHub Desktop.
Streamlit Logo Extractor from URL
import streamlit as st
from PIL import Image
import requests
from io import BytesIO
input_link = st.text_input("Paste Link of Website", value="https://www.google.com")
logo_link = input_link + "/favicon.ico"
response = requests.get(logo_link)
img = Image.open(BytesIO(response.content))
st.image(img)
# This Link -> https://www.google.com/s2/favicons?sz=64&domain_url={WEBSITE_URL} can also be used.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment