Client-Side Web Programming
Libraries
[http://utidylib.berlios.de/ utidylib] and [http://www.egenix.com/files/python/mxTidy.html mxTidy] -- Python interfaces to [http://tidy.sourceforge.net/ html tidy] library to clean up HTML documents.
[http://www.crummy.com/software/BeautifulSoup/ BeautifulSoup] -- a permissive HTML parser.
Don't use [http://python.org/doc/current/lib/module-HTMLParser.html HTMLParser] on HTML that might be invalid! That way lies pain. Either clean it up (using tidy), or use a different parser.
[http://python.org/doc/current/lib/module-urllib.html urllib], [http://python.org/doc/current/lib/module-urllib2.html urllib2], and [http://python.org/doc/current/lib/module-httplib.html httplib] in the standard library.
[http://wwwsearch.sourceforge.net/ClientCookie/ ClientCookie], [http://wwwsearch.sourceforge.net/ClientForm/ ClientForm], and [http://wwwsearch.sourceforge.net/mechanize/ Mechanize] are higher-level libraries for writing a web client.