Cookies

Discussion in 'Perl Misc' started by wassup, Sep 6, 2009.

  1. wassup

    wassup Guest

    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!
     
    wassup, Sep 6, 2009
    #1
    1. Advertising

  2. Re: Cookies [Firefox/IE]

    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=
     
    Andrzej Adam Filip, Sep 7, 2009
    #2
    1. Advertising

  3. wassup

    wassup Guest

    Re: Cookies [Firefox/IE]

    On Sep 7, 12:09 am, Andrzej Adam Filip <>
    wrote:
    > 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=


    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.
     
    wassup, Sep 7, 2009
    #3
  4. wassup

    Guest

    Re: Cookies [Firefox/IE]

    On 7 Sep., 01:39, wassup <> 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)
     
    , Sep 7, 2009
    #4
  5. wassup

    Guest

    Re: Cookies [Firefox/IE]

    On 2009-09-07, <> wrote:
    > On 7 Sep., 01:39, wassup <> 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".
     
    , Sep 7, 2009
    #5
  6. wassup

    Guest

    Re: Cookies [Firefox/IE]

    On 7 Sep., 15:53, wrote:

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


    <innocent>
    What is crooked about that?
    </innocent>
     
    , Sep 7, 2009
    #6
  7. wassup

    wassup Guest

    Re: Cookies [Firefox/IE]

    On Sep 7, 4:33 pm, ""
    <> wrote:
    > On 7 Sep., 15:53, 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
    ....
     
    wassup, Sep 7, 2009
    #7
  8. wassup

    wassup Guest

    Re: Cookies [Firefox/IE]

    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
    ....
     
    wassup, Sep 8, 2009
    #8
  9. wassup

    Uri Guttman Guest

    Re: Cookies [Firefox/IE]

    >>>>> "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 ---------
     
    Uri Guttman, Sep 8, 2009
    #9
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Alex Nitulescu

    Response.Cookies vs Request.Cookies

    Alex Nitulescu, Feb 3, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    8,516
    Hans Kesting
    Feb 3, 2005
  2. Andy Fish
    Replies:
    3
    Views:
    6,545
    Fredrik Lindner
    Nov 6, 2003
  3. user
    Replies:
    3
    Views:
    678
    =?ISO-8859-1?Q?G=F6ran_Andersson?=
    Mar 31, 2007
  4. archana
    Replies:
    1
    Views:
    513
  5. _Who
    Replies:
    7
    Views:
    2,699
Loading...

Share This Page