Cookies

W

wassup

hi. is there a way to convert a FF/IE cookie into using it with
mechanize? cuz, i want to login a site that uses recaptcha, and
mechanize can't login that way, so i was thinking of using a cookie
that would make the site think i was already logged in, skiping the
login process.. is this possible? if yes, how can it be done? thanks
in advance!
 
A

Andrzej Adam Filip

wassup said:
hi. is there a way to convert a FF/IE cookie into using it with
mechanize? cuz, i want to login a site that uses recaptcha, and
mechanize can't login that way, so i was thinking of using a cookie
that would make the site think i was already logged in, skiping the
login process.. is this possible? if yes, how can it be done? thanks
in advance!

Have you tried to use HTTP::Cookies::Mozilla (For firefox) or
HTTP::Cookies::Microsoft (or IE) provided at CPAN.org?

According to description it should deliver what you want.
 
W

wassup

wassup said:
hi. is there a way to convert a FF/IE cookie into using it with
mechanize? cuz, i want to login a site that uses recaptcha, and
mechanize can't login that way, so i was thinking of using a cookie
that would make the site think i was already logged in, skiping the
login process.. is this possible? if yes, how can it be done? thanks
in advance!

Have you tried to use HTTP::Cookies::Mozilla (For firefox) or
HTTP::Cookies::Microsoft (or IE) provided at CPAN.org?

According to description it should deliver what you want.

--
[pl>en Andrew] Andrzej Adam Filip : (e-mail address removed) : (e-mail address removed)
But it does move!
  -- Galileo Galilei
http://groups.google.com/[email protected]

i haven't tried that.. i just searched for the HTTP::Cookies::Mozilla
package in ubuntu, but didn't find it, how should i install it? thanks
again.
 
C

claus.kick

i haven't tried that.. i just searched for the HTTP::Cookies::Mozilla
package in ubuntu, but didn't find it, how should i install it? thanks
again.

CPAN Istallation:

1. perl -MCPAN -e shell
a cpan:> shell opens

2. install MOdule::Name
* (i.e.: install DBD::mysql)
 
G

greymausg

CPAN Istallation:

1. perl -MCPAN -e shell
a cpan:> shell opens

2. install MOdule::Name
* (i.e.: install DBD::mysql)

You crooked hacker!.. Let us know how you get on!.
 
C

claus.kick

On 7 Sep., 15:53, (e-mail address removed) wrote:

[...]
You crooked hacker!.. Let us know how you get on!.

<innocent>
What is crooked about that?
</innocent>
 
W

wassup

On 7 Sep., 15:53, (e-mail address removed) wrote:

[...]


You crooked hacker!.. Let us know how you get on!.

<innocent>
What is crooked about that?
</innocent>

so, is this correct then?

#!/usr/bin/perl

use strict;
use warnings;
use WWW::Mechanize;
use HTTP::Cookies::Mozilla;

$HTTP::Cookies::Mozilla::SQLITE = '/usr/bin/sqlite3';
my $cookiefile = "/home/user/.mozilla/firefox/q17733ib.default/
cookies.sqlite";

my $m = WWW::Mechanize->new;

$m->cookie_jar($cookiefile);

$m->get("http://www.whateverpage.com/test.php");

etc
etc
....
 
W

wassup

this one doesnt seem to output any erros, but i still cant use the
page... what is wrong here?

#!/usr/bin/perl

use strict;
use warnings;
use WWW::Mechanize;
use HTTP::Cookies;


my $cookie_jar = HTTP::Cookies::Netscape->new(file => "/root/.netscape/
navigator/bbj1xsox.default/cookies.txt",autosave => 1,);

my $m = WWW::Mechanize->new( cookie_jar=> $cookie_jar);

$m->get("http://www.whateverpage.com/test.php");

etc
etc
....
 
U

Uri Guttman

w> this one doesnt seem to output any erros, but i still cant use the
w> page... what is wrong here?

w> #!/usr/bin/perl

w> use strict;
w> use warnings;
w> use WWW::Mechanize;
w> use HTTP::Cookies;


w> my $cookie_jar = HTTP::Cookies::Netscape->new(file => "/root/.netscape/
w> navigator/bbj1xsox.default/cookies.txt",autosave => 1,);

w> my $m = WWW::Mechanize->new( cookie_jar=> $cookie_jar);

w> $m->get("http://www.whateverpage.com/test.php");

it is likely that you need the cookie that comes from logging in to the
page itself. if you use an old cookie from a previous login it may not
work because the site timed out the session. so you have to login fresh
with the user/password in the auth part of the request.

uri
 

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,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top