Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > Cookies

Reply
Thread Tools

Cookies

 
 
wassup
Guest
Posts: n/a
 
      09-06-2009
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!
 
Reply With Quote
 
 
 
 
Andrzej Adam Filip
Guest
Posts: n/a
 
      09-06-2009
wassup <> wrote:

> 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 : :
But it does move!
-- Galileo Galilei
http://groups.google.com/groups?selm...na.chmurka.net
 
Reply With Quote
 
 
 
 
wassup
Guest
Posts: n/a
 
      09-06-2009
On Sep 7, 12:09*am, Andrzej Adam Filip <Andrzej.Fi...@gmail.com>
wrote:
> wassup <wassu...@gmail.com> wrote:
> > 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 : a...@onet.eu : Andrzej.Fi...@gmail.com
> But it does move!
> * -- Galileo Galilei
> http://groups.google.com/groups?selm...na.chmurka.net


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.
 
Reply With Quote
 
claus.kick@googlemail.com
Guest
Posts: n/a
 
      09-07-2009
On 7 Sep., 01:39, wassup <wassu...@gmail.com> wrote:

> 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)
 
Reply With Quote
 
greymausg@mail.com
Guest
Posts: n/a
 
      09-07-2009
On 2009-09-07, <> wrote:
> On 7 Sep., 01:39, wassup <wassu...@gmail.com> wrote:
>
>> 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)


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


--
Greymaus....
Are You a `human` or a `zombie`?
Case A, vote "No".
 
Reply With Quote
 
claus.kick@googlemail.com
Guest
Posts: n/a
 
      09-07-2009
On 7 Sep., 15:53, greyma...@mail.com wrote:

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


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

 
Reply With Quote
 
wassup
Guest
Posts: n/a
 
      09-07-2009
On Sep 7, 4:33*pm, "claus.k...@googlemail.com"
<claus.k...@googlemail.com> wrote:
> On 7 Sep., 15:53, greyma...@mail.com 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
....
 
Reply With Quote
 
wassup
Guest
Posts: n/a
 
      09-08-2009
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
....
 
Reply With Quote
 
Uri Guttman
Guest
Posts: n/a
 
      09-08-2009
>>>>> "w" == wassup <> writes:

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

--
Uri Guttman ------ -------- http://www.sysarch.com --
----- Perl Code Review , Architecture, Development, Training, Support ------
--------- Gourmet Hot Cocoa Mix ---- http://bestfriendscocoa.com ---------
 
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
Give Request.Cookies and Response.Cookies is there any reason to use another method to use cookies? _Who ASP .Net 7 09-18-2008 07:49 PM
What's the proper way of reading cookies? Request.Cookies("mycook") doesnt work user ASP .Net 3 03-31-2007 01:53 PM
Response.Cookies vs Request.Cookies Alex Nitulescu ASP .Net 1 02-03-2005 09:43 AM
Persistent Cookies vs. session cookies Andy Fish Java 3 11-06-2003 10:44 AM
Good Cookies bad Cookies? AK Computer Support 23 10-26-2003 05:20 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57