using cgi form via http and extracting results

Tim Roberts timr at
Tue Jan 6 02:39:30 CET 2004

bmgx <bmgx_no_sp at> wrote:

>I would like to use an already existing online service (currency 
>converter) basically consisting of a html form with a few options that 
>is submitted and returns the results. I really don't know where to start 
>but I have assumed the following steps need to be taken:
>1) Make an http connection to the remote script (http://server/script.cgi)
>2) Fill out the html form (1x TEXT and 2x SELECT input fields)
>3) Submit the form
>4) extract the actual returned result. (using regex or something..)

You don't actually need steps 1 and 2 at all.  HTTP transactions are all
completely separate.  The results of a form submission are just a URL.  If
the form has fields "FromCurrency", "ToCurrency", and "Amount", all you
have to do is this:

You don't have to HAVE the form source in order to submit a request.
- Tim Roberts, timr at
  Providenza & Boekelheide, Inc.

More information about the Python-list mailing list