in reply to Re^3: WWW::Mechanize::Firefox and dynamic pages
in thread WWW::Mechanize::Firefox and dynamic pages

Maybe the additional elements live in another iframe? What is the XPath expression you get from Firebug for the new elements?

  • Comment on Re^4: WWW::Mechanize::Firefox and dynamic pages

Replies are listed 'Best First'.
Re^5: WWW::Mechanize::Firefox and dynamic pages
by Special_K (Pilgrim) on Jul 28, 2013 at 15:49 UTC

    The XPath returned from the code is:

    /html/body/div/p/a

      This is weird - as the list lives in the main document, it certainly should show up with ->content() after the elements have been added. I'm not aware of any caching going on. You will need to debug this on your own, and make sure that your parsing actually picks up the correct value from ->content (or even use the nodes as returned by ->selector or ->xpath directly.

        Does it matter that the link I'm trying to capture from the page with my script resides inside of an iframe? It looks like this in firebug:

        <iframe id="iframe_canvas" class="smart_sizing_iframe" scrolling="yes" + height="800" frameborder="0" msallowfullscreen="" oallowfullscreen=" +" mozallowfullscreen="" webkitallowfullscreen="" src="javascript:""" +name="iframe_canvas_fb_https" style="height: 472px;"> <html> <head> <body> <div> <a href="link I'm trying to capture"</a> </div> </body> </head> </html> </iframe>

        I already have this in my perl code:

        $mech->allow(plugins => 1, javascript => 1, metaredirects => 1, frames + => 1, subframes => 1, images => 1);

        So it seems like all iframes should be processed correctly, right?