jquery - PhantomJs : Screen capture of webpage loading data with $.POST fails -


i using phantomjs screen-capture website.

it happens on webpages loads data jquery ajax call instead of requesting given remoteurl, phantomjs requests current webpage url. leads re-including current page current page given example:

this code executed on $('document').ready() on webpage i'm trying screen-capture:

remoteurl = $('#my-placeholder').data('api-url');  $.post(     remoteurl,     {         foo: bar     },     function(response){         $('#my-placehoder').html(response);          // instead of retrieving remoteurl's content,          // result contains same content current page     } ); 

here's code use phantomjs:

page.open(address, function (status) {     if (status !== 'success') {         console.log('unable load address!');         phantom.exit();     } else {         page.evaluate(function() {             document.body.bgcolor = 'white';         });         var arr = page.evaluate(function () {             var pagewidth = document.body.clientwidth;             var pageheight = document.body.clientheight;              return [pagewidth, pageheight];         });          page.viewportsize = { width: arr[0], height: arr[1] };         page.render(output);         phantom.exit();     } }); 

is there kind of limitations in phantomjs that? or doing wrong?

i've been looking clues can helps me solving issue, google remains unhelpful. thanks!

edit : ok, after test error & console message binded, got this

typeerror: 'undefined' not function (evaluating '$(".is-clickable:not(.is-disabled)").clickevent()')    :9327   :4   :4   :4 

wich don't occurs in regular browser. seems related none-availability of jquery ?


Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -