I am hoping to write a script that will go through a directory and check if the html files are badly formed. Please see my code
directory = "html"
for root, dirs, files in os.walk(directory):
for file in files:
if str(file).endswith('.html'):
#Help needed here
if file is badly formed:
print "Badly Formed"
else:
print "Well Formed"