Entering HTTPS web page

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

I am trying to enter a HTTPS site -- Google Answers, for example. I
found this simple Google Answers client at Google Answers
(http://answers.google.com/answers/threadview?id=28442 ).

Here's the code:

++++++++++++ Begin Code ++++++++++++

use LWP;
use HTTP::Request::Common;
use HTTP::Cookies;


$ua = LWP::UserAgent->new;

'https://answers.google.com/answers/main?cmd=login ', ['email'=>$email,
password=>$pass, 'submit'=>'Login']);
if ($req->content=~ /Invalid login/){
    print "invalid login!\n";
    print "welcome to google answers :)\n";
'https://answers.google.com/answers/main?cmd=myinvoices ');
    print $req->content;
    $req->content=~/<td> Current Earnings \(what you will be paid\)
for Answering Questions: <\/td> <td width="1%">
    $req->content=~/<td> Current Balance \(what you will be charged\)
for Asked Questions: <\/td> <td width="1%"> $([0-9]+(?:.[0-9]+)?)/;
    print "Will be paid: $ear \nWill be charged: $char\n";

++++++++++++ End Code ++++++++++++

Every time I run the code, I get a "400 URL missing" error.

Any help would be appreciated.


Re: Entering HTTPS web page

 mahaan@gmail.com (Mahaan) wrote:

> $req=$ua->request(POST
> 'https://answers.google.com/answers/main?cmd=login ', ['email'=>$email,
> password=>$pass, 'submit'=>'Login']);

Try using 'POST' instead of POST, and follow it with a comma.

Dan Wilga          dwilga-MUNGE@mtholyoke.edu
** Remove the -MUNGE in my address to reply **

Site Timeline