Re: Help with a module.

From: Gunnar Strand (MyFirstnameHere.News1_at_gustra.org)
Date: 06/15/04

  • Next message: Sisyphus: "Re: Problem with Math::GMP"
    Date: Tue, 15 Jun 2004 18:25:58 +0200
    
    

    Hi Jim,

    I have used the LWP suite to talk to sites, and it does supports https
    (according to the documentation).

    Below is an example of a login (non-HTTPS) where $ua is an LWP::UserAgent
    object:

    sub login {
       my $req = new HTTP::Request( 'GET' =>
                                    "http://the.site/login" );

       my $res = $ua -> request( $req );
       unless ( $res -> is_success ) {
         die "ERROR: ".$res->status_line;
       }

       my $form = HTML::Form -> parse( $res -> content(), $res -> base() );
       $form -> value( 'login' => $user );
       $form -> value( 'password' => $password );
       $req = $form -> make_request();

       $res = $ua -> request( $req );
       unless ( $res -> is_success ) {
         die "ERROR: ".$res->status_line;
       }
    }

    Regards,

    /Gunnar

    Jim Simpson wrote:
    > Jo,
    >
    > Thanks for the suggestion on the stripper. That should help after I get the
    > data out of the secure site but I need something to talk to a secure site.
    >
    > Jim
    >
    > "Jo Andreas P. Sama" <jas@vafancolo.com> wrote in message
    > news:2j8hs6FutbjqU1@uni-berlin.de...
    >
    >>Jim Simpson wrote:
    >>
    >>
    >>>At the end of every week and again at the end of each month, I manually
    >
    > open
    >
    >>>several secure sites - callup the login site and enter user name and
    >>>password - then callup the *** I need to copy or download data from.
    >
    > At
    >
    >>>this point I have an Excel macro to process the data.
    >>>
    >>>I'm trying to make my task easier by writing a Perl script to do the
    >
    > part
    >
    >>>that is now manual - enter the user name and password and download the
    >>>required data. Can someone direct me to a module to help with this task
    >
    > or
    >
    >>>point me to a source of info on this?
    >>>
    >>>Thanks,
    >>>
    >>>Jim
    >>>
    >>>
    >>
    >>http://search.cpan.org/modlist/World_Wide_Web
    >>The LWP and URI modules might come in handy,
    >>I don't know if they have the ability to talk
    >>with secure sites, but it might be worth a look.
    >>
    >>HTML::Stripper might be nice if you will need to
    >>strip off all that HTML.
    >>
    >>--
    >>Best regards,
    >>Jo Andreas P. Sama
    >>http://vafancolo.com
    >
    >
    >


  • Next message: Sisyphus: "Re: Problem with Math::GMP"