Skip to content

Instantly share code, notes, and snippets.

@kamath7
Last active June 6, 2020 21:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kamath7/0bc64501fc079983fcd6a52739146721 to your computer and use it in GitHub Desktop.
Save kamath7/0bc64501fc079983fcd6a52739146721 to your computer and use it in GitHub Desktop.
const puppeteer = require('puppeteer');
(async()=>{
try{
const browser = await puppeteer.launch();
const page = await browser.newPage();
await page.goto('https://www.myntra.com/jeans/pepe-jeans/pepe-jeans-women-black-lara-lola-regular-fit-mid-rise-clean-look-stretchable-jeans/11280352/buy')
// await page.waitForSelector()
const body = await page.evaluate(()=>{
return document.querySelector('.pdp-price').textContent;
})
console.log(body);
await browser.close();
}catch(error){
console.log(`Error LMAO: ${error}`)
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment