## 42.4. Python and the Web

Python has a number of core modules designed to deal with interacting with the web. Python can act as a web client, pulling down web resources and POSTing form results. Python has support for SSL connections in a reasonably transparent fashion. CGI scripts are easy to write in Python, and there is also an Apache module for running Python scripts within the webserver itself.

- urllib (Section 42.5) provides basic functions for opening and retrieving web resources via their URLs.

- urllib2 (Section 42.6) provides an extended, extensible interface for accessing web resources.

- htmllib and HTMLParser (Section 42.7) provide the ability to parse HTML.

- cgi (Section 42.8) provides functions for writing CGI scripts.

- mod_python (Section 42.9) is an Apache module for running Python within the Apache webserver, rather than seperately as with CGI scripts.

-- DJPH

Copyright © 2003 O'Reilly & Associates. All rights reserved.