1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Join our Telegram chat: https://t.me/a_parser_en
    Dismiss Notice

Pagination issue

Discussion in 'A-Parser Support Forum' started by IStores, May 30, 2019.

  1. IStores

    IStores A-Parser Enterprise License
    A-Parser Enterprise

    Joined:
    Dec 4, 2018
    Messages:
    11
    Likes Received:
    3
    Hi,

    I am trying to parse pages that the following pagination:

    Code:
     <li class="current">
                <span class="show-for-sr" data-page="1">You're on page</span>1
            </li>
            <li >
                <a href="?page=2" rel="next" aria-label="Page 2" data-page="2">2</a>
            </li><li class="ellipsis" aria-hidden="true"></li>
            <li >
                <a href="?page=53" rel="next" aria-label="Page 53" data-page="53">53</a>
            </li>
            <li >
                <a href="?page=54" rel="next" aria-label="Page 54" data-page="54">54</a>
            </li>
                    <li class="pagination-next ">
                        <a href="#" aria-label="Next page" data-next><span class="show-for-sr">page</span></a>
                    </li>
                </ul>
    if I try with # it doesnt work, so I think solution is to get the link before rel="next" how would I do this so pagination is https://domain.com/category?page?=2 and the next page https://domain.com/category?page?=3 etc

    Thanks
     
  2. Support

    Support Administrator
    Staff Member A-Parser Enterprise

    Joined:
    Mar 16, 2012
    Messages:
    4,377
    Likes Received:
    2,107
    Hello.
    Please specify what exactly the question is?
    If you need help with the implementation of the passage of pagination, then give a link to the page where you need to do it, I will see and tell you how better to do it.
     
  3. IStores

    IStores A-Parser Enterprise License
    A-Parser Enterprise

    Joined:
    Dec 4, 2018
    Messages:
    11
    Likes Received:
    3
    Thanks,

    Yes I am stuck doing pagination.

    For example

    /productos/informatica/ordenadores

    Thanks
     
    #3 IStores, May 30, 2019
    Last edited: May 30, 2019
  4. Support

    Support Administrator
    Staff Member A-Parser Enterprise

    Joined:
    Mar 16, 2012
    Messages:
    4,377
    Likes Received:
    2,107
    Just use this regular expression in Check next page function:
    Code:
    <li class="current">[\s\S]+?<\/li>\s*<li[^>]*>\s*<a[^>]+href="([^"]+)[^>]+rel="next"
    [​IMG]
     
  5. IStores

    IStores A-Parser Enterprise License
    A-Parser Enterprise

    Joined:
    Dec 4, 2018
    Messages:
    11
    Likes Received:
    3
    Great!

    thank you!
     
    Support likes this.

Share This Page