Customize element XPath
FollowXPath is a language that allows you to locate specific elements from a web page. Modifying XPath in Octoparse works very well with more flexibility and accuracy than the XPath auto-generated by clicking elements during the task configuration.
Octoparse allows you to customize the element XPath so that you can precisely locate the data you are going to scrape. This helps resolve data missing, page skipped, blank fields, and duplicates.
In this tutorial, we are going to show you how to customize element XPath.
Where can I modify XPath in Octoparse?
- Click on the icon
on the data preview
- Select "Customize XPath"
- Enter the new XPath in Matching XPath textbox
For steps like "Loop Item", "Pagination" or "Click Item", you can easily find the XPath textbox under "General Settings" too. Enter the new XPath and click "Apply" to save your changes.
How to write XPath?
If you are new to XPath, you might need to grab some basics of HTML first. XPath locates elements based on tags and attributes. So before you get down to write your own XPath, you would need to inspect the HTML structure of the page first. (More tutorials about HTML )
You can check out this tutorial to learn more about XPath: What is XPath and how to use it in Octoparse
If you need any help with task configuration or data collection, submit a ticket to our support team! We'll get back to you within 24 hours.
Author: Brian
Editor: Yina