Hmm this is an interesting question. If you have access to the backend of this form there is a far easier way to solve this problem I'm sure.
However, if you can't you want to look up how to essentially do http calls from python and you'll need to know a lot about that form. I'd look into urllib the python library.
To learn more about it go to your Unix command line and type 'python'. Once you have a prompt type 'import urllib' and 'dir(urllib)' or 'help(urllib)'. You can call these two functions on any of the levels down too. I.e. 'dir(urllib.somemethod)'