OSINT_Tool / src /url_fetcher.py
Canstralian's picture
Create src/url_fetcher.py
51d1e83 verified
raw
history blame
428 Bytes
import requests
import re
def fetch_url_title(url):
try:
response = requests.get(url)
if response.status_code == 200:
match = re.search('<title>(.*?)</title>', response.text)
if match:
return match.group(1)
else:
return None
else:
return None
except Exception as e:
print(f"Error: {e}")
return None