Skip to main content

How to handle 'Next 10 Pages' pagination

Create pagination for pages with the next 10 page button.

Updated over 2 months ago

When a website lacks a traditional "Next" button and instead has pagination like "Next 10 pages" or jumps to non-sequential pages (e.g., from page 1 directly to page 11), you need to adjust your pagination strategy.

Here's how to handle this scenario:

Note:
This method works for both missing "Next" buttons and jump-style pagination by targeting the specific page number links instead.

Step 1. Create a Pagination Loop

  • In your Octoparse workflow, click on the visible page number (e.g., "2" or "11") in the pagination bar

  • Select Loop click single URL from the action options

Step 2: Adjust the XPath to Locate the Correct Next Page

  • Click on your pagination element in the workflow

  • Replace the default XPath with:

    //a[@class="on"]/following-sibling::a[1]
  • This XPath specifically targets:

    • The currently active page (marked with class="on")

    • Then selects its immediate sibling link (the next available page number)

Finalize and Test:

  • Apply the XPath changes

  • Run a preview to verify the pagination works correctly

  • Adjust the XPath further if needed to handle your specific website structure

Why This Works:

  • The modified XPath bypasses the missing "Next" button by directly finding the next numbered page link

  • It's flexible enough to handle jumps in page numbering (like from 1 → 11 → 21)

  • Works similarly for both numbered pagination and missing "Next" button scenarios

💡Tip: If the pagination is particularly complex, consider combining this with batch URL generation for maximum reliability.

Did this answer your question?