await page.goto('https://example.com', { waitUntil: 'domcontentloaded' }); console.log(await page.title()); console.log(page.url());
await page.goto('https://example.com', wait_until='domcontentloaded') print(await page.title()) print(page.url)
await page.click('#search-input'); await page.type('#search-input', 'hello world'); await page.click('#submit-button');
await page.click('#search-input') await page.type('#search-input', 'hello world') await page.click('#submit-button')
await page.waitForSelector('.results', { timeout: 5000 });
await page.wait_for_selector('.results', timeout=5000)
const text = await page.$eval('.price', el => el.innerText);
text = await page.locator('.price').inner_text()
await page.screenshot({ path: 'screenshot.png' });
await page.screenshot(path='screenshot.png')
const page2 = await browser.newPage(); await page2.goto('https://example.com/other');
page2 = await browser.new_page() await page2.goto('https://example.com/other')
Was this page helpful?