Skip to main content
All CollectionsBeyond BasicsXPath
Customize element XPath
Customize element XPath
Updated over 7 months ago

XPath 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 targeting. This helps resolve any issues such as data missing, page skipped, blank fields, and duplicates.


Where can I modify XPath in Octoparse?

Modify field XPath

  • Click More on the data preview for the field you'd like to customize with

8888.png
  • Select Customize XPath

877.png
  • Enter the new XPath in the Matching XPath textbox

18555.png

Modify Loop Item/Click Item XPath

  • For Loop Item, Pagination or Click Item, you can find the XPath textbox under General Settings

  • Enter the new XPath and click Apply to save your changes

5599.png

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.

We also have a tutorial regarding how to write Xpath, you can refer to: What is XPath and how to use it in Octoparse?

Did this answer your question?