Entering HTTPS web page

M

Mahaan

Hello,

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;

$email='(e-mail address removed)';
$pass='ottffss';

$ua = LWP::UserAgent->new;
$ua->cookie_jar(HTTP::Cookies->new);

$req=$ua->request(POST
'https://answers.google.com/answers/main?cmd=login', ['email'=>$email,
password=>$pass, 'submit'=>'Login']);
if ($req->content=~ /Invalid login/){
print "invalid login!\n";
}else{
print "welcome to google answers :)\n";
$req=$ua->request(GET
'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%">
\$([0-9]+(?:.[0-9]+)?)/;
$ear=$1;
$req->content=~/<td> Current Balance \(what you will be charged\)
for Asked Questions: <\/td> <td width="1%"> \$([0-9]+(?:.[0-9]+)?)/;
$char=$1;
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.

Thanks.
 

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. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top