P
Peter Dietrich
Hello everyone,
I would like to write a Perl script, that does a login to ebay. I have
searched the internet and newsgroup archives, but all I have found are bits
of information pertaining to the login-process without ssl or methods that
insert username and password directly into a url.
I have already written a few lines but am no at a point, where I don't know
what to do next.
The problem is that I have no information about the detailed authentication
process. I know it involves cookies. But neither do I know whether to send
cookies ebay left in the jar nor do I know how, where and when to send them.
This is as far as I have come (actually not that far):
#!usr/bin/perl
use warnings;
use strict;
use LWP::UserAgent;
use HTML::Form;
use HTTP::Cookies;
my $browser = LWP::UserAgent->new(agent=>"Mozilla/8.0");
$browser->cookie_jar(HTTP::Cookies->new(file => "cookies.txt"));
my $site =
$browser->get("http://my.ebay.de/ws/eBayISAPI.dll?MyeBay&ssPageName=h:h:mebay:DE");
# openssl and crypt::ssleay are installed
open FH, ">ebay.htm";
my @form = HTML::Form->parse($site);
my $input=$form[1]->inputs;
my $id = $form[1]->find_input("userid");
my $password = $form[1]->find_input("pass","password");
my $button = $form[1]->find_input("signinButton","submit");
$id->value("username");
$password->value("password");
my $request=$button->click($form[1]);
#print ("As_String: ",$request->as_string,"\n");
print FH $browser->post($request->uri)->as_string; # get or post?
close FH;
Does this even point to the right direction?
It would be very nice if someone could give me advice on how this can be
done.
Thanks in advance,
Peter Dietrich
Note: I have also posted this on comp.lang.perl.moderated, but the message
has not appeared there for two days now.
I would like to write a Perl script, that does a login to ebay. I have
searched the internet and newsgroup archives, but all I have found are bits
of information pertaining to the login-process without ssl or methods that
insert username and password directly into a url.
I have already written a few lines but am no at a point, where I don't know
what to do next.
The problem is that I have no information about the detailed authentication
process. I know it involves cookies. But neither do I know whether to send
cookies ebay left in the jar nor do I know how, where and when to send them.
This is as far as I have come (actually not that far):
#!usr/bin/perl
use warnings;
use strict;
use LWP::UserAgent;
use HTML::Form;
use HTTP::Cookies;
my $browser = LWP::UserAgent->new(agent=>"Mozilla/8.0");
$browser->cookie_jar(HTTP::Cookies->new(file => "cookies.txt"));
my $site =
$browser->get("http://my.ebay.de/ws/eBayISAPI.dll?MyeBay&ssPageName=h:h:mebay:DE");
# openssl and crypt::ssleay are installed
open FH, ">ebay.htm";
my @form = HTML::Form->parse($site);
my $input=$form[1]->inputs;
my $id = $form[1]->find_input("userid");
my $password = $form[1]->find_input("pass","password");
my $button = $form[1]->find_input("signinButton","submit");
$id->value("username");
$password->value("password");
my $request=$button->click($form[1]);
#print ("As_String: ",$request->as_string,"\n");
print FH $browser->post($request->uri)->as_string; # get or post?
close FH;
Does this even point to the right direction?
It would be very nice if someone could give me advice on how this can be
done.
Thanks in advance,
Peter Dietrich
Note: I have also posted this on comp.lang.perl.moderated, but the message
has not appeared there for two days now.