mirror of
https://github.com/alabianca/OT_Reportv2.git
synced 2025-12-16 19:35:02 -06:00
21 lines
461 B
Python
21 lines
461 B
Python
from html.parser import HTMLParser
|
|
from bs4 import BeautifulSoup
|
|
|
|
# class MyHTMLParser(HTMLParser):
|
|
# def handle_starttag(self, tag, attrs):
|
|
# print("Encountered a start tag:", tag)
|
|
|
|
# def handle_endtag(self, tag):
|
|
# print("Encountered an end tag :", tag)
|
|
|
|
# def handle_data(self, data):
|
|
# print("Encountered some data :", data)
|
|
|
|
with open('test.html') as file:
|
|
soup = BeautifulSoup(file)
|
|
print(soup.prettify())
|
|
|
|
|
|
|
|
|