I am trying to scrape TripAdvisor but only want to scrape the records for the first 10 pages - i.e. limit the Element click selector to 10 so that it opens the restaurant links on each of the first 10 pages and scrapes the 30 restaurant results. per page giving me a total of 300 results.
I have tried using the n:th child solution suggested by @iconocalst but can't get this to work.
Url: https://www.tripadvisor.co.za/Restaurants-g60878-Seattle_Washington.html
Sitemap:
{"_id":"tripadvisor","startUrl":["https://www.tripadvisor.co.za/Restaurants-g60878-Seattle_Washington.html"],"selectors":[{"id":"Next","type":"SelectorElementClick","parentSelectors":["_root","Next"],"selector":"div.restaurants-list-ListCell__cellContainer--2mpJS:nth-of-type(n+3) a.restaurants-list-ListCell__restaurantName--2aSdo","multiple":true,"delay":"2000","clickElementSelector":"a.nav.next:nth-child(-n+9)","clickType":"clickMore","discardInitialElements":"do-not-discard","clickElementUniquenessType":"uniqueHTML"},{"id":"Restaurant Link","type":"SelectorLink","parentSelectors":["_root","Next"],"selector":"div.restaurants-list-ListCell__cellContainer--2mpJS:nth-of-type(n+3) a.restaurants-list-ListCell__restaurantName--2aSdo","multiple":true,"delay":0},{"id":"Restaurant Name","type":"SelectorText","parentSelectors":["Restaurant Link"],"selector":"h1.ui_header","multiple":false,"regex":"","delay":0},{"id":"Claimed","type":"SelectorText","parentSelectors":["Restaurant Link"],"selector":"div.restaurants-claimed-badge-ClaimedBadge__container--32Ufv","multiple":false,"regex":"","delay":0},{"id":"Overall Rating","type":"SelectorText","parentSelectors":["Restaurant Link"],"selector":"span.restaurants-detail-overview-cards-RatingsOverviewCard__overallRating--nohTl","multiple":false,"regex":"","delay":0},{"id":"Number of reviews","type":"SelectorText","parentSelectors":["Restaurant Link"],"selector":"a.restaurants-detail-overview-cards-RatingsOverviewCard__ratingCount--DFxkG","multiple":false,"regex":"","delay":0},{"id":"Ranking","type":"SelectorText","parentSelectors":["Restaurant Link"],"selector":"div.restaurants-detail-overview-cards-RatingsOverviewCard__ranking--17CmN","multiple":false,"regex":"","delay":0},{"id":"Awards","type":"SelectorText","parentSelectors":["Restaurant Link"],"selector":"div.restaurants-detail-overview-cards-RatingsOverviewCard__award--31yzt","multiple":false,"regex":"","delay":0},{"id":"Rating Food","type":"SelectorElement","parentSelectors":["Restaurant Link"],"selector":"div.restaurants-detail-overview-cards-RatingsOverviewCard__ratingQuestionRow--5nPGK:nth-of-type(1)","multiple":false,"delay":0},{"id":"Rating Service","type":"SelectorElement","parentSelectors":["Restaurant Link"],"selector":"div.restaurants-detail-overview-cards-RatingsOverviewCard__ratingQuestionRow--5nPGK:nth-of-type(2)","multiple":false,"delay":0},{"id":"Rating Value","type":"SelectorElement","parentSelectors":["Restaurant Link"],"selector":"div.restaurants-detail-overview-cards-RatingsOverviewCard__ratingQuestionRow--5nPGK:nth-of-type(3)","multiple":false,"delay":0},{"id":"Rating Atmosphere","type":"SelectorElement","parentSelectors":["Restaurant Link"],"selector":"div.restaurants-detail-overview-cards-RatingsOverviewCard__ratingQuestionRow--5nPGK:nth-of-type(4)","multiple":false,"delay":0},{"id":"Mentioned In","type":"SelectorHTML","parentSelectors":["Restaurant Link"],"selector":"div.restaurants-detail-overview-cards-MentionsOverviewCard__mentionsList--3bwkV","multiple":false,"regex":"","delay":0},{"id":"Details","type":"SelectorHTML","parentSelectors":["Restaurant Link"],"selector":".restaurants-details-card-DetailsCard__innerDiv--1Imq5 div.ui_columns","multiple":false,"regex":"","delay":0},{"id":"View all details","type":"SelectorElementClick","parentSelectors":["Restaurant Link"],"selector":"a.restaurants-detail-overview-cards-DetailsSectionOverviewCard__viewDetails--ule3z","multiple":false,"delay":"1000","clickElementSelector":"a.restaurants-detail-overview-cards-DetailsSectionOverviewCard__viewDetails--ule3z","clickType":"clickMore","discardInitialElements":"do-not-discard","clickElementUniquenessType":"uniqueText"},{"id":"Details Pop Up","type":"SelectorHTML","parentSelectors":["Restaurant Link"],"selector":"div.restaurants-detail-overview-cards-DetailsSectionOverviewCard__detailsContent--1hucM","multiple":false,"regex":"","delay":0},{"id":"Rating - Food","type":"SelectorText","parentSelectors":["Rating Food"],"selector":"span.restaurants-detail-overview-cards-RatingsOverviewCard__ratingText--1P1Lq","multiple":false,"regex":"","delay":0},{"id":"Rating Food #","type":"SelectorElementAttribute","parentSelectors":["Rating Food"],"selector":"span.ui_bubble_rating","multiple":false,"extractAttribute":"class","delay":0},{"id":"Rating - Service","type":"SelectorText","parentSelectors":["Rating Service"],"selector":"span.restaurants-detail-overview-cards-RatingsOverviewCard__ratingText--1P1Lq","multiple":false,"regex":"","delay":0},{"id":"Rating - Service #","type":"SelectorElementAttribute","parentSelectors":["Rating Service"],"selector":"span.ui_bubble_rating","multiple":false,"extractAttribute":"class","delay":0},{"id":"Rating - Value","type":"SelectorText","parentSelectors":["Rating Value"],"selector":"span.restaurants-detail-overview-cards-RatingsOverviewCard__ratingText--1P1Lq","multiple":false,"regex":"","delay":0},{"id":"Rating - Value #","type":"SelectorElementAttribute","parentSelectors":["Rating Value"],"selector":"span.ui_bubble_rating","multiple":false,"extractAttribute":"class","delay":0},{"id":"Rating - Atmosphere","type":"SelectorText","parentSelectors":["Rating Atmosphere"],"selector":"span.restaurants-detail-overview-cards-RatingsOverviewCard__ratingText--1P1Lq","multiple":false,"regex":"","delay":0},{"id":"Rating -Atmosphere #","type":"SelectorElementAttribute","parentSelectors":["Rating Atmosphere"],"selector":"span.ui_bubble_rating","multiple":false,"extractAttribute":"class","delay":0}]}