in reply to Re: capturing dynamic page
in thread capturing dynamic page

what I mean is: I use a script to create the web page, so, in the address heading it say: http://myscript.pl

myscript.pl parses the form parameters and then decides which subs to call from another script, allthepagesandforms.pm, which then pulls a whole mess of info from a database and with this data finishes putting together a web page. BUT, in the address heading, it just says http://myscript.pl

That's what I mean. What I'd like to do is take one of these dynamically produced web pages and, instead of just parsing the form parameters..store the entire web page source code along with the parameters in a file. can you help me with this? Thank you

Replies are listed 'Best First'.
Re^3: capturing dynamic page
by Anonymous Monk on May 10, 2012 at 06:52 UTC

    what I mean is: I use a script to create the web page, so, in the address heading it say: http://myscript.pl

    Um, that is not possible, unless myscript.pl is the name of your host

    What I'd like to do is take one of these dynamically produced web pages and, instead of just parsing the form parameters..store the entire web page source code along with the parameters in a file.

    Store it where?

    can you help me with this? Thank you

    See http://perldoc.perl.org/perlintro.html#Files-and-I%2fO and follow the links I gave you

      thank you..I read the section on file handles..from what I can see, it still needs a name. please show me if I've missed something

      Sorry..you are right. It's http://website.com/cgi-bin/myscript.pl

      The problem remains the same..using Get(http://website.com/myscript.pl) out of lwp does not get me the results I am after. No matter what page shows up in the browser, it says http://mywebsite.com/cgi-bin/myscript.pl

      the field forms are consistently parsed by cgi.pm, so, I'm thinking the entire page must be being parsed to get at the form tags. Does cgi.pm have a variable that is already holding the entire page I can call,use and manipulate?

      I have read through the docs you've recommended, and, again, I'm sure I'm missing something rather simple, but, I'm just not seeing it.

      $query=new CGI;

      @names=$query->param;

      gives me an array of all the parameters

      is there a function call to give me the entire page? if not, is there another way to get the entire page, when the address for every page is the same? thank you

        Hi, different Anonymous monk here. (Either that, or I have a multiple personality disorder. I wouldn't count that out.)

        No matter what page shows up in the browser, it says http://mywebsite.com/cgi-bin/myscript.pl

        Your form is being submitted to myscript.pl in that address via the HTTP POST method. The method usually requires key-value pairs for the query part. You should be searching what the required key-value pairs (well, not strictly pairs) are (the name and value attributes in the form you are submitting), and then read the LWP documentation on how to make a POST request with the pairs.

        The result of that POST request will be the HTTP response that contains the HTML page.