I can't find any decoded_content method documented in WWW::Mechanize::PhantomJS (?)
You're right. It's a WWW::Mechanize method, so I just presumed it worked with WWW::Mechanize::PhantomJS as well. I'll give content a try. Thanks!

UPDATE: No difference. Same exact result as the decoded_content method.

Otherwise are you sure your JS-App really works inside PhantomJS? It wouldn't be the first case of browser incompatibilities.
Yeah, I don't know. That's a good point. Maybe not?

UPDATE #2: OK, so I think that's the problem. I added print $_->{message},"\n" for $mech->js_errors(); to my code, and I'm getting a mess of TypeError: undefined is not a function (evaluating ...) JavaScript errors that I don't see in any major web browser.

How very disappointing. I guess I'll have to try to get WWW::Mechanize::Firefox working...

Or maybe I can inject some polyfills? Seems others have encountered this sort of problem with PhantomJS:
https://github.com/tom-james-watson/phantomjs-polyfill
https://github.com/mathiasbynens/String.prototype.startsWith

I might try that first... I'm thinking the best way to do that is to copy ghostdriver/src/main.js and add the polyfills to that?


In reply to Re^6: How do I get WWW::Mechanize::PhantomJS to wait until the JavaScript on the web page has finished executing? (update) by Darth Ed
in thread How do I get WWW::Mechanize::PhantomJS to wait until the JavaScript on the web page has finished executing? by Darth Ed

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.