I found one script for accessing app info from this forum.Basically, i am accessing facebook apps and may install it automatically.

I tried to see if i get a permission dialog page by following code but it does not return the permission page rather the first page.

what facebook do is multiple redirects or meta or sends few other request and then lands the user to permission page where i need to click allow button. But i am not able to get that final permission page for many apps. Here is the code,

use strict; use WWW::Mechanize; use HTTP::Cookies; my $url = "http://www.facebook.com"; my $appurl = "http://apps.facebook.com/funmoods/"; my $username = 'mail'; my $password = 'pass'; my $mech = WWW::Mechanize->new(); $mech->cookie_jar(HTTP::Cookies->new()); $mech->get($url); $mech->form_name('menubar_login'); $mech->field(email => $username); $mech->field(pass => $password); $mech->click(); my $facebook_content = $mech->content(); # go to an app url $mech->get($appurl); my $app_content = $mech->content(); print "$app_content\n";

I don't know why mechanize does not access final loaded page. it took some time to load the permission page but mechanize always returns first source page. How i can tell mechanize to wait till it loads all the pages?

Need help thanks

In reply to Mechanize and Facebook App by ahelpyguy

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.