Pagination: why always 1 step back?

Hi,

I need to scrape a website and have some troubles with the pagination. If you try my scraper, you first have to wait to a site with more than 1 subdomains (for example "Bürobedarf". There are 5 subdomains. My pagination works as follows: It starts with the first site, goes to the second and returns to the first, so: 1, 2, 1, 2, 3, 4, 3, 4, 5. The scraper always takes one step back. Why?

Thank you!

{"_id":"rewe_jjjj_mm_dd","startUrl":["https://shop.rewe.de/allcategories"],"selectors":[{"id":"links","parentSelectors":["_root"],"type":"SelectorLink","selector":".lr-category__top .lr-category__item a:nth-of-type(1)","multiple":true,"linkType":"linkFromHref"},{"id":"produkt","parentSelectors":["element"],"type":"SelectorText","selector":"span.art-Truncate__Spreader_7D1PHZ","multiple":false,"regex":""},{"id":"preis","parentSelectors":["element"],"type":"SelectorText","selector":"div.search-service-productPrice, div.search-service-productOfferPrice","multiple":false,"regex":""},{"id":"angebot","parentSelectors":["element"],"type":"SelectorText","selector":"div.search-service-productOfferDuration","multiple":false,"regex":""},{"id":"einheit","parentSelectors":["element"],"type":"SelectorText","selector":".productGrammage div","multiple":false,"regex":""},{"id":"gefahr","parentSelectors":["element"],"type":"SelectorElementAttribute","selector":"g g path[fill='#FFF']","multiple":false,"extractAttribute":"fill"},{"id":"gesponsort","parentSelectors":["element"],"type":"SelectorText","selector":"div.search-service-pictureWrapper.pictureWrapper","multiple":false,"regex":""},{"id":"artnr","parentSelectors":["element"],"type":"SelectorElementAttribute","selector":"a.search-service-productDetailsLink","multiple":false,"extractAttribute":"href"},{"id":"artnr2","parentSelectors":["element"],"type":"SelectorElementAttribute","selector":"meso-data[data-productid]","multiple":true,"extractAttribute":"data-productid"},{"id":"pagination","parentSelectors":["links","pagination"],"paginationType":"auto","type":"SelectorPagination","selector":"form.paginationPage:not(.paginationPageActive) button[type="submit"]"},{"id":"element","parentSelectors":["pagination"],"type":"SelectorElement","selector":"section.search-service-product","multiple":true,"scroll":false,"elementLimit":0}]}
image

Hi,

If you check 'Element preview', your pagination selector matched 3 elements. Ideally, it should match only the next button. Try setting it to button[aria-label="Seite vor"]

1 Like

Great, thank you!.....

1 Like