I am trying to write a program that will take an HTML file and output each line. I am doing something wrong because my code is outputting each letter. How can I get all the HTML lines into a list?
This is the code so far:
f = open("/home/tony/Downloads/page1/test.html", "r")
htmltext = f.read()
f.close()
for t in htmltext:
print t + "\n"
No comments:
Post a Comment