modules client access to http requests is provided by the http client modulealthough the higher-level urllib package' modulesurllib parseurllib requesturllib responseurllib errorand urllib robotparserprovide easier and more convenient access to urls grabbing file from the internet is as simple asfh urllib request urlopen("html fh read(decode("utf "the urllib request urlopen(function returns an object that behaves much like file object opened in read binary mode here we retrieve the python web site' index html file (as bytes object)and store it as string in the html variable it is also possible to grab files and store them in local files with the urllib request urlretrieve(function html and xhtml documents can be parsed using the html parser moduleurls can be parsed and created using the urllib parse moduleand robots txt files can be parsed with the urllib robotparser module data that is represented using json (javascript object notationcan be read and written using the json module in addition to http server and client supportthe library provides xml-rpc (remote procedure callsupport with the xmlrpc client and xmlrpc server modules additional client functionality is provided for ftp (file transfer protocolby the ftplib modulefor nntp (network news transfer protocolby the nntplib moduleand for telnet with the telnetlib module the smtpd module provides an smtp (simple mail transfer protocolserverand the email client modules are smtplib for smtpimaplib for imap (internet message access protocol)and poplib for pop (post office protocolmailboxes in various formats can be accessed using the mailbox module individual messages (including multipart messagescan be created and manipulated using the email module if the standard library' packages and modules are insufficient in this areatwisted (www twistedmatrix comprovides comprehensive third-party networking library many third-party web programming libraries are also availableincluding django (www djangoproject comand turbogears (www turbogears orgfor creating web applicationsand plone (www plone organd zope (www zope orgwhich provide complete web frameworks and content management systems all of these libraries are written in python xml |there are two widely used approaches to parsing xml documents one is the dom (document object modeland the other is sax (simple api for xmltwo dom parsers are providedone by the xml dom module and the other by the xml dom minidom module sax parser is provided by the xml sax mod