Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > Entering HTTPS web page

Reply
Thread Tools

Entering HTTPS web page

 
 
Mahaan
Guest
Posts: n/a
 
      09-20-2004
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 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.
 
Reply With Quote
 
 
 
 
Dan Wilga
Guest
Posts: n/a
 
      09-20-2004
In article <(E-Mail Removed)> ,
http://www.velocityreviews.com/forums/(E-Mail Removed) (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 (E-Mail Removed)
** Remove the -MUNGE in my address to reply **
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
server side redirect https => https NOT working Axel ASP General 8 04-27-2009 02:02 AM
https authentication & storing https page in string Naveen Dhanuka Ruby 1 09-19-2007 02:05 PM
open-uri and HTTPS, or net/https with a redirect jotto Ruby 4 10-02-2006 07:26 AM
Need solution for entering email address to view a page Larry Webb HTML 0 11-17-2005 10:39 PM
Entering Info on One Page, used in 2nd Page Tobe ASP .Net 1 07-08-2003 02:22 AM



Advertisments