Javascript Pagination - gets data from only two pages out of 40

I am trying to scrape a website that has a NEXT button. I've used a link selector to select all the relevant links on the page and then an element click to click the NEXT button the link selector is a child of this element click and of root. When the scraper runs it goes through maybe 10 pages (25 items per page) before following the link selector links. When I get the results, theres only 50 entries.
Url: https://www.rightmove.co.uk/property-to-rent/find.html?searchType=RENT&locationIdentifier=REGION^1164&insId=1&radius=0.0&minPrice=&maxPrice=&minBedrooms=&maxBedrooms=&displayPropertyType=&maxDaysSinceAdded=&sortByPriceDescending=&_includeLetAgreed=on&primaryDisplayPropertyType=&secondaryDisplayPropertyType=&oldDisplayPropertyType=&oldPrimaryDisplayPropertyType=&letType=&letFurnishType=&houseFlatShare=

Sitemap:
{"_id":"rightmove_rental_data","startUrl":["https://www.rightmove.co.uk/property-to-rent/find.html?searchType=RENT&locationIdentifier=REGION^1164&insId=1&radius=0.0&minPrice=&maxPrice=&minBedrooms=&maxBedrooms=&displayPropertyType=&maxDaysSinceAdded=&sortByPriceDescending=&_includeLetAgreed=on&primaryDisplayPropertyType=&secondaryDisplayPropertyType=&oldDisplayPropertyType=&oldPrimaryDisplayPropertyType=&letType=&letFurnishType=&houseFlatShare="],"selectors":[{"id":"property","type":"SelectorLink","parentSelectors":["_root","next"],"selector":"div.propertyCard-details a.propertyCard-link","multiple":true,"delay":0},{"id":"description","type":"SelectorText","parentSelectors":["property"],"selector":"h1.fs-22","multiple":false,"regex":"","delay":0},{"id":"address","type":"SelectorText","parentSelectors":["property"],"selector":"div.left address.pad-0","multiple":false,"regex":"","delay":0},{"id":"price","type":"SelectorText","parentSelectors":["property"],"selector":"p.property-header-price strong","multiple":false,"regex":"","delay":0},{"id":"key_features","type":"SelectorGroup","parentSelectors":["property"],"selector":"ul.list-two-col","delay":0,"extractAttribute":""},{"id":"full_description","type":"SelectorText","parentSelectors":["property"],"selector":"div.left p:nth-of-type(1)","multiple":false,"regex":"","delay":0},{"id":"furnishing","type":"SelectorText","parentSelectors":["property"],"selector":"td#furnishedType","multiple":false,"regex":"","delay":0},{"id":"deposit","type":"SelectorText","parentSelectors":["property"],"selector":"tr:contains('Deposit:') td:nth-of-type(2)","multiple":false,"regex":"","delay":0},{"id":"next","type":"SelectorElementClick","parentSelectors":["_root"],"selector":"h2.propertyCard-title","multiple":true,"delay":"5000","clickElementSelector":"button.pagination-button.pagination-direction--next span","clickType":"clickMore","discardInitialElements":false,"clickElementUniquenessType":"uniqueText"}]}

Hi,

The kind of pagination you are trying to achieve just works if the 'Next' button is a link (+the pagination has to a child to itself as well for it to work properly)

But in this case you just need to select the item/property card with the main selector and then the 'Next' button with the Click selector. After that just use the link selector within each individual card.

Hope this helps.

Here is a working version of the sitemap:

{"_id":"rightmove_rental_data","startUrl":["https://www.rightmove.co.uk/property-to-rent/find.html?searchType=RENT&locationIdentifier=REGION^1164&insId=1&radius=0.0&minPrice=&maxPrice=&minBedrooms=&maxBedrooms=&displayPropertyType=&maxDaysSinceAdded=&sortByPriceDescending=&_includeLetAgreed=on&primaryDisplayPropertyType=&secondaryDisplayPropertyType=&oldDisplayPropertyType=&oldPrimaryDisplayPropertyType=&letType=&letFurnishType=&houseFlatShare="],"selectors":[{"id":"property","type":"SelectorLink","parentSelectors":["property-card"],"selector":"div.propertyCard-details a.propertyCard-link","multiple":false,"delay":0},{"id":"description","type":"SelectorText","parentSelectors":["property"],"selector":"h1.fs-22","multiple":false,"regex":"","delay":0},{"id":"address","type":"SelectorText","parentSelectors":["property"],"selector":"div.left address.pad-0","multiple":false,"regex":"","delay":0},{"id":"price","type":"SelectorText","parentSelectors":["property"],"selector":"p.property-header-price strong","multiple":false,"regex":"","delay":0},{"id":"key_features","type":"SelectorGroup","parentSelectors":["property"],"selector":"ul.list-two-col","delay":0,"extractAttribute":""},{"id":"full_description","type":"SelectorText","parentSelectors":["property"],"selector":"div.left p:nth-of-type(1)","multiple":false,"regex":"","delay":0},{"id":"furnishing","type":"SelectorText","parentSelectors":["property"],"selector":"td#furnishedType","multiple":false,"regex":"","delay":0},{"id":"deposit","type":"SelectorText","parentSelectors":["property"],"selector":"tr:contains('Deposit:') td:nth-of-type(2)","multiple":false,"regex":"","delay":0},{"id":"property-card","type":"SelectorElementClick","parentSelectors":["_root"],"selector":".propertyCard-wrapper","multiple":true,"delay":"2500","clickElementSelector":".pagination-direction--next","clickType":"clickMore","discardInitialElements":false,"clickElementUniquenessType":"uniqueCSSSelector"}]}

1 Like