


We can use this attribute to write the XPath: (Check out how to write an XPath here )Įnter the XPath into Octoparse to check if it can always locate the next button.Īfter making a pagination loop in a task, You'd better manually click the "Click to paginate" action to go to several pages as this tutorial shows to check if the auto-generated XPath could locate the next button precisely. You can firstly inspect the next button in FireFox to check the source code: It is easy to solve such issue: just modify the XPath to make sure it will always locate the next button. Octoparse to go through lists and search pages, buttons and pagination, to get URLs of. So after finishing scraping the second page, Octoparse would directly go to the page 10, missing a lot of data on the pages in between. Lacking ability to scrap multiple matching XPath per page. You can even get the data from multiple pages using pagination. If not, you may need to modify the XPath for the 'Pagination'. If the action works well, the next page displays in the built-in browser. Click 'Click to Pagination' to check whether the next-page button is located in the loop item area accurately. However, on the second page, the XPath locates the page 10. I use the Xpath to extract data and run regular expressions on it to clean it up and do. and Extract multiple pages through pagination. links, etc Extract data from listing pages, sites with infinite scrolling, pagination, etc. point-and-click web data extraction Pagination, interaction, chaining, authentication, typing Advanced extraction: XPath, CSS Selectors, RegEx, JS. On the first page, you can see the pagination loop XPath locates the next button perfectly. See what developers are saying about how they use Octoparse. Have a look at the following example: ( Example URL) That is caused by the auto-generated XPath of the pagination loop not always locating the next page button on every page. Now we need to modify the XPath of the 'Click to paginate' action which is the most important part of dealing with the page number type of pagination. For example, after it successfully scrapes the first two pages, it directly jumps to the page 5, then maybe page 10, but not go to the pages in sequence. With the current setup, Octoparse will simply keep clicking on '1' as it tries to paginate to the next page, leading to duplicated data being extracted endlessly. Many users have encountered such case that Octoparse skips some pages when scraping a website. Click on the Next Page button, select Loop click single element, and set up the AJAX timeout as 10s The auto-generated XPath for Pagination does not always work in this case, so we need to modify the XPath to make it scrape all the pages. The latest version for this tutorial is available here. for pagination manually by dragging a Loop Item into the workflow and clicking the Next Page button to create a Click Item action. Create a Pagination - to scrape from multiple pages.
