remove urlinfo module

This commit is contained in:
jkhsjdhjs 2023-07-16 23:30:03 +00:00
parent eec79067d8
commit 1259db8212

View File

@ -1,31 +0,0 @@
#!/usr/bin/python3
import re
import requests
from bs4 import BeautifulSoup
def is_url(msg):
regex = r"(https?:\/\/(?:www\.)?\S+)"
match = re.search(regex, msg)
if match:
url = match.group(1)
return url
else:
return None
def get_data(url):
r = requests.get(url)
data = r.text
r.close()
return data
def get_title(url):
data = get_data(url)
soup = BeautifulSoup(data, 'html.parser')
title = soup.title.string
del soup
return title