import { Frame } from "https://deno.land/x/pptr@1.2.0/mod.ts";
Examples
Example 1
Example 1
const puppeteer = require('puppeteer');
(async () => {
const browser = await puppeteer.launch();
const page = await browser.newPage();
let currentURL;
page.mainFrame()
.waitForSelector('img')
.then(() => console.log('First URL with image: ' + currentURL));
for (currentURL of ['https://example.com', 'https://google.com', 'https://bbc.com']) {
await page.goto(currentURL);
}
await browser.close();
})();
Parameters
optional
options: WaitForSelectorOptions = [UNSUPPORTED]- options to define if the element should be visible and how long to wait before timing out.
Returns
Promise<ElementHandle | null>
a promise which resolves when an element matching the selector string is added to the DOM.