I'm trying to scrape all the reviews below;
https://apps.apple.com/jp/app/mcdonalds-japan/id413618155?l=en#see-all/reviews
If you could see the reviews are occluded, so you need;
- Click to see the review
- Scroll to see more
I'm still far to go, but I've tried this code;
import puppeteer from 'puppeteer';
const url = "https://apps.apple.com/jp/app/mcdonalds-japan/id413618155?l=en#see-all/reviews";
(async () => {
try {
const browser = await puppeteer.launch({
headless: false
});
const page = await browser.newPage();
await page.goto(
url,{
waitUntil: "domcontentloaded"
});
await page.waitForTimeout(4000);
let result = await page.evaluate(() => {
const items = Array.from(document.querySelectorAll("div"));
return items
})
console.log(result);
await browser.close();
} catch (e) {
console.error();
}
})();
But the result returns empty, not sure what I did wrong.
[
{}, {}, {}, {}, {}, {}, {}, {},
{}, {}, {}, {}, {}, {}, {}, {},
{}, {}, {}, {}, {}, {}, {}, {},
{}, {}, {}
]