I used Beautiful Soup https://www.crummy.com/software/BeautifulSoup/bs4/doc/
I'm doing a Python course, if I'm wrong, sorry (I'm learning)
# pip install beautifulsoup4
# import beautifulsoup4
from bs4 import BeautifulSoup
# Read the contents of the HTML file
with open("./website.html") as file:
contents = file.read()
# Parse the HTML content using BeautifulSoup
soup = BeautifulSoup(contents, "html.parser")
print(soup) # print the entire HTML document
# Print the title of the HTML document
print(soup.title) # <title>My Website</title>
print(soup.title.string) # My Website