Skip to content

Tag: puppeteer

Loop through pages to return all the product links

The goal is to obtain all product links from all pages in the pagination. So far I have managed to print information to the console with console.log (links). However, since I am completely new to this field and completely inexperienced, I have a problem how to pass some value back with the return command. ret…

Get dataset object from an element in Puppeteer

Say i have this element: I’d like to get the data attributes via dataset. I can use the code below to get an individual data attribute, but if i want to get both data-* attributes, i’d have to scrape twice. I’ve tried this, but returns an empty object Answer Managed to accomplish it with thi…

scrollIntoView() looping element on puppeteer

I want to scrape a list of posts while the page scroll is infinite loading. I want scrollIntoView() for each element in the loop. my code is temporarily like this and the result when the page is loaded, it bounces out but no error. For example, I want to take 20 posts and then the scraper will take the posts

How to click and hold in Puppeteer

I am trying to click and hold using Puppeteer. I tried using page.click inside a while loop but it didn’t work. I also tried this: Any ideas how to do this? Answer There are a few tools to trigger a mouse hold in Puppeteer: page.click, mouse.click, mouse.down and mouse.up. page.hover can be useful for p…