how to retrieve the header information from a html page ???

Discussion in 'Perl Misc' started by senthilS, Mar 24, 2005.

  1. senthilS

    senthilS Guest

    Here is the sample scenario :

    A cgi request is going to a server say a webserver or a application
    server, that server is configured to redirect this request to a
    "sample.html" page.

    This html page is just a test page just to get this request.

    Now I want to retrieve the header information of this sample.html page.

    Is there anyway we can script to get header information from
    sample.html whenever the server redirects all request to this
    sample.html page

    senthilS, Mar 24, 2005
    1. Advertisements

  2. Start with LWP. Create a user agent and submit a POST requst to the form.

    When a response comes back, it will be a redirect to the sample page.
    Examine the response to get the URL of the sample page, then do a second
    HEAD request to that URL.

    That's the general idea. For details, see the LWP module on CPAN. For higher
    level automation - session tracking, form parsing, etc. - have a look at
    WWW::Mechanize, also on CPAN.

    Sherm Pendley, Mar 24, 2005
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.