websites and cookies?

Discussion in 'Perl Misc' started by Tomasz Chmielewski, Sep 24, 2008.

  1. I have a webmail which is protected by a "user/password" form (one which
    you can find in any webmail, i.e. squirrelmail, yahoo/google mail etc.).

    The webmail is the only way to fetch mail; there is no POP3/IMAP there.


    Therefore, I'd like to write a Perl script which will "log in" to that
    page automatically, parse certain pages (inbox, new mail, save it as
    files etc.).

    As far as I understand, I need to "emulate" a webbrowser a bit:
    1) log in to a website (fill proper form fields, send it to the web server)
    2) get the cookie, browse other pages using that cookie


    What do I need to implement it in a Perl script?

    I'm not looking for a ready solution, I just need some terms to look up
    (CGI::Cookie perhaps for handling cookies; but how do I fill a form to
    obtain the cookie? links browser?).

    Any links to Perl examples would be great too, of course.


    --
    Tomasz Chmielewski
    http://wpkg.org
    Tomasz Chmielewski, Sep 24, 2008
    #1
    1. Advertising

  2. Tomasz Chmielewski <> writes:

    > As far as I understand, I need to "emulate" a webbrowser a bit:
    > 1) log in to a website (fill proper form fields, send it to the web server)
    > 2) get the cookie, browse other pages using that cookie
    >
    > What do I need to implement it in a Perl script?


    Have a look at WWW::Mechanize

    sherm--

    --
    My blog: http://shermspace.blogspot.com
    Cocoa programming in Perl: http://camelbones.sourceforge.net
    Sherm Pendley, Sep 24, 2008
    #2
    1. Advertising

  3. Tomasz Chmielewski <> wrote:
    > I have a webmail which is protected by a "user/password" form (one which
    > you can find in any webmail, i.e. squirrelmail, yahoo/google mail etc.).
    >
    > The webmail is the only way to fetch mail; there is no POP3/IMAP there.
    >
    >
    > Therefore, I'd like to write a Perl script which will "log in" to that
    > page automatically, parse certain pages (inbox, new mail, save it as
    > files etc.).
    >
    > As far as I understand, I need to "emulate" a webbrowser a bit:



    You can use the Web Scraping Proxy to write Perl code that
    emulates a browser. Google for "Web Scraping Proxy".


    > 1) log in to a website (fill proper form fields, send it to the web server)
    > 2) get the cookie, browse other pages using that cookie
    >
    >
    > What do I need to implement it in a Perl script?



    WWW::Mechanize (or LWP::UserAgent).


    --
    Tad McClellan
    email: perl -le "print scalar reverse qq/moc.noitatibaher\100cmdat/"
    Tad J McClellan, Sep 25, 2008
    #3
    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,456
    Hans Kesting
    Feb 3, 2005
  2. Andy Fish
    Replies:
    3
    Views:
    6,506
    Fredrik Lindner
    Nov 6, 2003
  3. user
    Replies:
    3
    Views:
    649
    =?ISO-8859-1?Q?G=F6ran_Andersson?=
    Mar 31, 2007
  4. archana
    Replies:
    1
    Views:
    499
  5. _Who
    Replies:
    7
    Views:
    2,636
Loading...

Share This Page