I am trying to find the first table
in a HTML
file and copy everything of the table
to a string s
f = open('page.html' , 'r')
s = ""
for line in f.readlines():
line = line.strip()
if line.find('<table'):
s += line
if line.find('</table>'):
break
print s
This code is not working. How do I solve it using the standard python library?