Skip to main content

Set up an alternative XPath

Learn how to set up an alternative XPath in Octoparse to improve data field accuracy when the main XPath fails.

Updated over a week ago

Sometimes, a data field may appear in different locations on different pages. In such cases, it’s useful to set up a backup XPath in case the primary XPath fails to locate the element. If Octoparse can’t find the target data field using the primary XPath, it will automatically try the backup XPath (also called the alternative XPath) to capture the desired data.

This tutorial will teach you how to set up an alternative XPath.


1. Click on the More icon- select Customize XPath

  • Click on the ... More icon from your target data field

  • Select Customize XPath


2. Input the alternative XPath

  • Tick the option for Try alternative XPath.

  • Input the alternative XPath

Note: Relative XPath and backup XPath cannot be used at the same time. If a relative XPath is applied to locate a data field, the backup XPath will be disabled.

Did this answer your question?