Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Perl to automate CGI query?

by emmiesix (Novice)
on Feb 22, 2011 at 22:21 UTC ( [id://889685]=perlquestion: print w/replies, xml ) Need Help??

emmiesix has asked for the wisdom of the Perl Monks concerning the following question:

The question is very basic. Can I use perl (about the only 'scripting' language I know) to fill out a CGI form (such as http://fermi.gsfc.nasa.gov/cgi-bin/ssc/LAT/LATDataQuery.cgi) and submit? (Once I get the return page I can handle parsing the html and downloading the data via wget). I see that a cgi perl module exists, but it seems to be geared towards creating your own forms for your own server. I have long been doing big automated downloads using html queries (where the relevant stuff is in the URL), but I'm honestly confused where to go with CGI.

I need to query NASA's server for several thousand objects... a push (or a shove) in the right direction would be appreciated.

Replies are listed 'Best First'.
Re: Perl to automate CGI query?
by ikegami (Patriarch) on Feb 22, 2011 at 22:39 UTC
      I wanted to come back and say thanks... I tried the LWP method first with no success, but www::mechanize was perfect. I was quite pleased when one of the NASA techs showed a graph with a big spike in it for data downloads... didn't want to tell them it was all due to my script... :)
Re: Perl to automate CGI query?
by 7stud (Deacon) on Feb 22, 2011 at 23:03 UTC
    I just wanted to add: there is no such thing as a "cgi form". There is something called an "html form", and whether it was produced by a cgi script or not is irrelevant.
      Well, if you want to get really technical about it, there is something called an HTTP POST Request; as is shown by the above answer, whether it was submitted from an HTML form is irrelevant. :-)
      To be fair, that form submits to a script which has ".cgi" on the end of it, and that's what I think they meant.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://889685]
Approved by ikegami
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (4)
As of 2024-04-19 14:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found