Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

page.evaluateHandle method missed in puppeteer #21

Open
vasanthudhaya opened this issue Nov 8, 2019 · 3 comments
Open

page.evaluateHandle method missed in puppeteer #21

vasanthudhaya opened this issue Nov 8, 2019 · 3 comments

Comments

@vasanthudhaya
Copy link

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
Copy link
Owner

tungs commented Nov 11, 2019

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
      });
   }
   //...
});

@vasanthudhaya
Copy link
Author

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

@florinvirdol
Copy link

florinvirdol commented Aug 31, 2022

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants