Parsing

Thomas Berglund thomas.berglund at minpost.nu
Wed Jul 3 20:17:40 EDT 2002


Hello all

I'm new to this group and new to python =).

I was thinking, as a first project, to have a program that would
download a random quote from a homepage that gives such, parse all the
html out of it and print it. Should be simple, no?

Well, i've been messing around with something like this:

urllib.urlretrieve("http://kisrael.com/quotes/", "temp.txt")

f = open("temp.txt")
for line in f.readlines():
	if line[0] != "<":
		print line
f.close()

but, that's not really working out. I was just wondering if there was
some kind of standard parsing library for python to help me get rid of
those nasty html tags. Any pointers would me much appreciated.

Have a nice day, and thanks.

/Thomas



More information about the Python-list mailing list