I am using PhantomJS to get positions of certain elements on the page, for instance iframes or objects. Presently I
page.includeJs("http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js", function() {
page.evaluate(function() {
// Select attr etc..
position = $(this).position();
offset = $(this).offset();
});
});
I've tried adding $(window).load() to the formula but it still isn't returning the correct element position a lot of the time. Especially with iFrames and Objects. Perhaps they're positioned after the DOM has loaded? Either way does anyone have any ideas how I can improve or change method to get much more accurate positions?
Kind regards,
Fab