tungs/timecut

page.evaluateHandle method missed in puppeteer

vasanthudhaya opened this issue · 3 comments

Hi @tungs, thanks for the timecut repo. I checked the time-snap index.js. you wrote all the functions are on promise type. On that the page.evaluateHandle puppeter method is not present. Kindly let me know how to include or implement the evaluatehandle method in timecut.

cc: @varunarora

tungs commented

Hi @vasanthudhaya -- I'm not exactly sure what you're trying to do and how you're trying to do it. If you're talking about using the undocumented (and unsupported) config.preparePage, timesnap should be passing page as an argument.

So in your code would look something like this:

timecut({
   //...
   preparePage: function (page) {
      return page.evaluateHandle(function () {
         return document.getElementById('element');
      }).then(function (handle) {
         // code with handle here
      });
   }
   //...
});

Thanks @tungs. But i need one more is to enable a button and need to click the button before page screenshot. I tried with prepagepage function, even-though the screenshot is capturing very fast. From my scenario i need to click the button once the page loaded success after that i wanna to capture the screen. Kindly let me know what to do for this.

cc: @varunarora

Hi,
A little late to the party.. I'm interested in achieving something similar to what @vasanthudhaya said, eg.: clicking a button after page loaded or wait for some element to load, and before making screenshots.
Any updates on this, please, @tungs ?

Thank you!