We waited for the search button selector to load. Don't worry Puppeteer will wait for you to do that, thanks to setDefaultTimeout(0) What did we do next? You have to scan the QR code on the WhatsApp web before you login. SetDefaultTimeout(0) is to ensure that Puppeteer does not snap out of the page because it's taking too much time to load or open. ![]() Of course we added await because it's an asynchronous call and we don't know how long it will take to get a response. We instructed Puppeteer to go to the provided URL - WhatsApp's URL. Let's create an Express app to begin withĮnter fullscreen mode Exit fullscreen mode Revert to the Puppeteer docs to see how to do it You can actually skip the download if you want to. Note: When you install Puppeteer, it downloads a recent version of Chromium (~170MB Mac, ~282MB Linux, ~280MB Win) that is guaranteed to work with the API. Puppeteer runs headless by default, but can be configured to run full (non-headless) Chrome or Chromium. Puppeteer is a Node library which provides a high-level API to control Chrome or Chromium over the DevTools Protocol.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |