From 51792961277de1d169f2040bbecf4b46623f60bc Mon Sep 17 00:00:00 2001 From: Sherlock <82929505+AvMavs@users.noreply.github.com> Date: Sun, 15 Jan 2023 03:14:39 +0530 Subject: [PATCH] Create fontlink.py Created the script. --- fontlink.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 fontlink.py diff --git a/fontlink.py b/fontlink.py new file mode 100644 index 0000000..44b4c0f --- /dev/null +++ b/fontlink.py @@ -0,0 +1,15 @@ +import requests +from bs4 import BeautifulSoup + +def get_font_links(url): + response = requests.get(url) + soup = BeautifulSoup(response.text, 'html.parser') + fonts_link = [] + for tag in soup.find_all(["link"]): + if 'href' in tag.attrs and (tag['href'].endswith('.woff') or tag['href'].endswith('.woff2') or tag['href'].endswith('.ttf') or tag['href'].endswith('.otf')): + fonts_link.append(tag['href']) + return fonts_link + +url = "https://yourlinkhere" +font_links = get_font_links(url) +print(font_links)