How to limit number of scrapped elements from news site

My aim was to scrap some latest news from news site like cnn.com

Basically there are too many news, so my browser will crash if I use "element click selector" in "click to show more mode". I did not find any documented solution, so I made a new one. I want to share it so my fellow scrappers could use it until limitation feature will become available in product:

You can just use '":nth-child" pseudo-class from css in your selector field, for example:
"article.type-post:nth-child(-n+200) h4.entry-title"

This will only scrape 200 elements, then "element click selector" will stop to open new pages.

This solution works for me, hope it will help someone else, who works with infinite websites.

1 Like

I didn't even know you could use negative -n. I usually did it like this - article.type-post:not(:nth-child(n+200)) h4.entry-title. Your solution is much shorter and clearer. Thanks!