samedi 28 décembre 2019

How can i automate a expedia search with puppeteer

  1. This is the code to automate expedia search
async function run() {
  const browser = await puppeteer.launch({ headless: false }); //Launch browser
    // Open a new page and navigate to google.com
  const page = await browser.newPage(); //open a tab 
  await page.goto('https://www.expedia.com');  //Navigate to website URL
  const waitForLoad = new Promise(resolve => page.on('load', () => resolve()));
  await page.evaluate(() => {
  document.querySelector('#aria-option-1 > div > div.multiLineDisplay.details').click();
  });
  await waitForLoad;

}
  1. Thank you fo help !!



Aucun commentaire:

Enregistrer un commentaire