jquery - How to handle "TypeError: HTMLScriptElement" when scroll down with Phantomjs to load dynamic content -
i'm trying scroll down google play webpage (https://play.google.com/store/apps/category/health_and_fitness/collection/topselling_free) phantomjs.
i've tried method described in answer(how scroll down phantomjs load dynamic content), gives error message "typeerror: htmlscriptelement not function (evaluating 'el(kl(window.location.href))')" , doesn't works...
here's code..
page.open(url, function() { page.includejs("http://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js", function() { var cnt = 1; var history = 0; window.setinterval(function() { console.log(cnt); var rettext = page.evaluate(function() { window.document.body.scrolltop = document.body.scrollheight; return $("a.title").text(); }); var height = page.evaluate(function() { return document.body.scrolltop; }); cnt = cnt + 1; if(cnt > 10 || history == height){ console.log(rettext); console.log(system.args[2]) phantom.exit(); } history = height; //interval }, 5000); }); });
i think code works on of dynamic web pages there's disturb scrolling down in google webpages.
is there way resolve problem?
Comments
Post a Comment