'Scrapping data with puppeteer in Nodejs, Results are different

I want to scrap the text '1 views' from this URL "https://www.loom.com/share/5b920dc1375f43fa9b622ac0a6ba7c52"
Url of image: https://imgur.com/r8dbUbV

In browser console it gives result perfectly
Url of image: https://imgur.com/Z4XrR3f

but in puppeteer it gives 'Record a loom'
Url of image: https://imgur.com/zL1varD



Solution 1:[1]

I noticed a similar issue when trying different browsers. Your selector worked fine for me in Firefox, but not in Chrome. I'm assuming you are using Chrome with Puppeteer, as it is the default. If that's the case we are likely seeing the same issue. Anyway, try this selector out instead:

document.querySelector(`[class*="header-content"] span:nth-child(2)`)

Happy scraping, and cheers!

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Jscrip