Hey! I am trying to get LWP to work with this website however its not going too well. I think I am able to login, but it then redirects me to the login page again.
Note: This is test data. I don't acutally use this login info.
Your User ID : petnuc@cooper.edu
Your Password : vhNVf0jH
URL : https://noii.nasdaqtrader.com
And here is my code:
I am not really sure what I am doing wrong and why it is not going onto the next page. I though it was a redirct issue cause when I first tried it I was getting 302 errors, but this approad is not working either. Any clues? Thanks. Edited 2004-08-04 by Ovid -- hid username and password#!/usr/local/bin/perl -w use strict; use LWP::UserAgent; use HTTP::Cookies; my $browser = new LWP::UserAgent; $browser->cookie_jar( HTTP::Cookies->new( 'file' => "$ENV{HOME}/.cookies.txt", 'autosave' => 1) ); my $url = 'https://noii.nasdaqtrader.com'; my $response = $browser->post($url, [ txtUserName => '*****', txtUserPass => '*****' ] ); while($response->is_redirect) { my $location = $url . $response->header("location"); $response = $browser->get($location); if($response->is_success) { print $response->content; } else { print $response->status_line; } }
In reply to LWP and Site Logins by debiandude
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |