Files
Gainsight/Scripts/Anthology/find_domain_names.py

18 lines
478 B
Python

from requests_html import HTMLSession
from domains_list import DOMAINS
for domain in DOMAINS:
URL = f"https://{domain}"
session = HTMLSession()
resp = session.get(URL)
try:
title = resp.html.find('head > title', first=True)
group_name = title.text.split("|")
print(group_name)
except AttributeError as e:
print(e)
finally:
title = resp.html.find('head > meta:nth-child(3)', first=True)
print(title.text)