Unable to scrap data using Puppeteer
I used Puppeteer around 5 years ago. When I used now, it feels completely different and complicated. I don't understand why I'm unable to fetch simple name of movie from IMDB. Here is the screenshot of the issue. enter image description here
const puppeteer = require('puppeteer');
(async () => {
const browser = await puppeteer.launch({ headless: true });
const page = await browser.newPage();
await page.goto('https://www.imdb.com/title/tt0111161/', {
waitUntil: 'domcontentloaded'
});
const movieName = await page.$eval('h1[data-testid="hero-title-block__title"]', el => el.textContent);
console.log(movieName);
await browser.close();
})();