puppeteer: how to wait until an element is visible?

I think you can use page.waitForSelector(selector[, options]) function for that purpose. const puppeteer = require(‘puppeteer’); puppeteer.launch().then(async browser => { const page = await browser.newPage(); page .waitForSelector(‘#myId’) .then(() => console.log(‘got it’)); browser.close(); }); To check the options avaible, please see the github link.

Making HTTP Requests using Chrome Developer tools

Since the Fetch API is supported by Chrome (and most other browsers), it is now quite easy to make HTTP requests from the devtools console. To GET a JSON file for instance: fetch(‘https://jsonplaceholder.typicode.com/posts/1’) .then(res => res.json()) .then(console.log) Or to POST a new resource: fetch(‘https://jsonplaceholder.typicode.com/posts’, { method: ‘POST’, body: JSON.stringify({ title: ‘foo’, body: ‘bar’, userId: 1 … Read more

Chrome console already declared variables throw undefined reference errors for let

This happens when you introduce the temporal dead zone to the global scope. As you might know, let declarations are hoisted but left uninitialised. Due to control flow, it can happen that a variable is never initialised: function …() { if (false) example; // would throw a ReferenceError if it was evaluated … // do … Read more