I have a website to scrape and what I need to scrape is inside a div that has an id left_container_scroll that contains multiple a tags. This div has the infinite scroll on it and I can't make it work. I am trying to make the program scroll in that div.
I have tried to do something like this, but I get an error: Evaluation failed: ReferenceError: elem is not defined
htmlTag = '#left_container_scroll'; //I think I am doing something wrong here let elem = await page.evaluate((htmlTag)=> { return document.querySelector(htmlTag); }) previousHeight = await page.evaluate("elem.scrollHeight"); await page.evaluate("window.scrollTo(0,elem.scrollHeight)"); await page.waitForFunction(`elem.scrollHeight > ${previousHeight}`);