[KLUG Members] Re: Dynamic HTML/HTTP question
John Holland
members@kalamazoolinux.org
Thu, 5 Dec 2002 10:22:30 -0500
On Thu, Dec 05, 2002 at 01:46:14AM -0500, Robert G. Brown wrote:
> What I want to do is submit my query under program control, and
> without manual intervention. Put another way, I would like to know
> how to get the server to react AS IF someone had answered the requests
> for data by filling in something, and thus send along the response
> that would result from the processing of the query that is submitted.
What is the target language or environment? What are you trying to do
with the data once retrieved?
One solution is python:
>>> import urllib
>>> params = urllib.urlencode({'spam': 1, 'eggs': 2, 'bacon': 0})
>>> f = urllib.urlopen("http://www.musi-cal.com/cgi-bin/query", params)
>>> print f.read()
It can also be made to deal with persistent cookies.
--
--------------------------------------------------------------------
John Holland
john@zoner.org
http://www.zoner.org