Output of HTML parsing

Sebastian Wiesner basti.wiesner at gmx.net
Fri Jun 15 16:14:11 CEST 2007


[ Jackie <jackie.BPUG at gmail.com> ]
> 1.The code above assume that each Prof has a tilte. If any one of them
> does not, the name and title will be mismatched. How to program to
> allow that title can be empty?
>
> 2.Is there any easier way to get the data I want other than using
> list?

Use BeautifulSoup.

> 3.Should I close the opened csv file("professor.csv")? How to close
> it?

Assign the file object to a separate name (e.g. stream) and then invoke its 
close method after writing all csv data to it.

-- 
Freedom is always the freedom of dissenters.
                                      (Rosa Luxemburg)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 196 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.python.org/pipermail/python-list/attachments/20070615/1086e41c/attachment.pgp>


More information about the Python-list mailing list