Pagination. To only scrape next page and not previous page

Hi,

I am currently scraping this page. https://www.tokopedia.com/perkakaskubosch/page/2

For the pagination, i will like to only scrape the next page and not the previous page URL.

<div class="official-shop-paging">
<ul>
<li><a class="mr-10" href="https://www.tokopedia.com/perkakaskubosch">❮</a></li>
<li><a href="https://www.tokopedia.com/perkakaskubosch/page/3">❯</a></li>
</ul>
</div>

Previous page (denoted by a <) has a anchor class of "mr-10" while next page (denoted by >) does not have any anchor class.

My current selector is div.official-shop-paging li:last-of-type a

How should i modify the selector to only scrape next page and not previous page? Thank you!

PS. I forgot to elaborate. The reason i am asking is because on the last page, there is only a previous page and no next page.

<div class="official-shop-paging">
  <ul>
    <li><a class="mr-10" href="https://www.tokopedia.com/perkakaskubosch/page/2">❮</a></li>
  </ul>
</div>

Hence i am trying to build my sitemap such that when it comes to the last page, it does not go back to previous page again.

Here is your answer

Use Element Click Selector
I've built the basic map. it will also click on each product and scrape the details page. However, due to a language barrier, I didn't know what you wanted to scrape so I only chose two fields in the details page.

It will go through each page and stop when there is no more ">"

{"_id":"aa-testmap-tokopedia","startUrl":["https://www.tokopedia.com/perkakaskubosch"],"selectors":[{"id":"Change Page","type":"SelectorElementClick","parentSelectors":["_root"],"selector":"div.product","multiple":true,"delay":0,"clickElementSelector":"div.official-shop-paging li a:contains(\"❯\")","clickType":"clickMore","discardInitialElements":false,"clickElementUniquenessType":"uniqueCSSSelector"},{"id":"Name","type":"SelectorText","parentSelectors":["Change Page"],"selector":"div.name","multiple":false,"regex":"","delay":0},{"id":"Price","type":"SelectorText","parentSelectors":["Change Page"],"selector":"span.price","multiple":false,"regex":"","delay":0},{"id":"Click Product","type":"SelectorLink","parentSelectors":["Change Page"],"selector":"a","multiple":false,"delay":0},{"id":"Info","type":"SelectorText","parentSelectors":["Click Product"],"selector":"div.tab-pane.in","multiple":false,"regex":"","delay":0},{"id":"No Clue What this is","type":"SelectorText","parentSelectors":["Click Product"],"selector":"div.rvm-left-column--right div.rvm-buy-content span.inline-block","multiple":false,"regex":"","delay":0}]}

This works perfectly. Thanks!