I am new to Python, and have a specific task that I was curious to see if it could be implemented in Python.

I have access to a server that will accept requests to query a database utilizing HTTP URLs, and it responds to the request with the results in XML.

I wanted to be able to automate this process so that I didn't have to put the URL into a web browser, receive the XML, and then interpret the XML manually. Is there a way to submit a URL server request for data, and then receive and interpret the XML response from the server in Python?

Any help would be appreciated.


Hmmmm. What if you did:

import urllib

urllib.urlretrieve('url here','my_xml.xml',callback)

then you can open the xml file and do what you want with it. too good to be true?

Note that the module has been split into different parts in 3.0. The above would work in 2.6. And you would have to write you're own callback function (takes blocks,blocksize,total_blocks as arguments)

also may want to look into urllib.urlopen() (also different in 3.0)


Also, there is a MySQL python module on the web. I never had any luck getting it to work though.