Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Scrape data with cheerio and nodejs

I used cheerio module to scrape list of products from a website. But have problem, website using "Infinite Scrolling" to load data (data load more when scroll down). So, cheerio can't get all products.

Can someone suggest me a solutions for this problem ? Thanks you.

like image 493
rubiken Avatar asked Nov 01 '22 06:11

rubiken


1 Answers

You can check out what sort of queries the page performs when you scroll. Then just hit those queries yourself and get the data.

Alternatively you can try to use something like node-phantom-simple, trigger scroll via Phantom and scrape.

I would go with the first option myself.

like image 194
Juho Vepsäläinen Avatar answered Nov 10 '22 10:11

Juho Vepsäläinen