Printer Friendly Version Print this thread
Email this thread to a friend eMail this thread to a friend
  • Doorway Pages (In: Google)
  • MSN dropping pages out the index (In: MSN Search Engine)
  • Featured Web Site Template

    Hundreds More at Free Site Templates.com!

    Web Site Partners
    Sponsored Links
    Jet City Software
     
    Whos Here ?
    There are 0 guests and 1 members in the forums right now.
    Reflects user activity within the last 5 minutes
    Moderator(s): Prowler, jcokos
    Member Message

    yerman01
    Joined: Mar 12, 2005
    # Posts: 1

    View the profile for yerman01 Send yerman01 a private message

    Posted: 2005-Mar-12 16:44
    Edit Message Delete Message Reply to this message

    Hi everyone!
    I've developed a little perl program using the module LWP to download italian stock pages,
    to make real time statistics.
    The program works for delayed data, but it doesn't work for real time data because of the
    authentication.
    I mean the authentication is made at session level, so I need to authenticate in some
    way in the same program.
    I've tried to use $ua->credentials and $req->authorization_basic, but without results.
    I confess I'm novice in perl programming and in using LWP, and surely it's my fault.
    Can anyone help me?

    My simple code is:

    $protected_page="http://www.24oreborsaonline.ilsole24ore.com/fc?sezId=10026&cmd=miafinanza&page=ListinoPersonale";

    use LWP::UserAgent;
    $ua = LWP::UserAgent->new;

    #
    # Authentication block ???
    #

    $req = HTTP::Request->new(GET => "<$protected_page>"wink;

    $res = $ua->request($req);
    if ($res->is_success)
    {
    $out="c:/mypage.txt";
    open OUT, ">$out" or die "Cannot open $out for write :$!";
    print OUT $res->content;
    close OUT;
    }
    else
    {
    print "Time out: fault in download n";
    }


    If you would like to test if it works I can leave the logging credentials.

    Site logging page: [link]
    username: yer
    password: man

    I thank you in advance for whatever help you can give me.



    Prowler
    Staff
    Joined: Aug 14, 2000
    # Posts: 1788

    View the profile for Prowler Send Prowler a private message

    Posted: 2005-Mar-14 13:11
    Edit Message Delete Message Reply to this message

    At first glance I see that you have not used parameters for authentication in the Web User Agent class of LWP module.
    You might find this document http://cpan.uwinnipeg.ca/htdocs/libwww-perl/LWP/UserAgent.html
    helpful to assign suitable values.




    You are not permitted to post messages in this forum or topic, because of one or more of the following reasons:
    1. You have not yet logged in, or registered properly as a member
    2. You are a member, but no longer have posting rights.
    3. This is a private forum, for which you do not have permissions.

    If you are a recent member, it's possible that you simply have not yet confirmed your account. Please check your email for a message entitled 'JimWorld Forums: Confirm Your Account' and follow the instructions contained within.

    If you cannot find this message, click here to Re-Send it.

    If you are still experiencing problem, please read the Login Assistance Article for some advice on what may be causing your login not to work properly.

    Switch to Advanced Editor and ... Create a New Topic or Reply to this Thread

    New posts Forum is locked
    © 1995  ·  iWeb, Inc  ·  DBA JimWorld Productions