The smart decision engine helps Octoparse workflows handle variation in website structure and task behavior. It is useful when a task cannot follow the exact same path on every page or every run. Use smart decision logic when a workflow needs to respond to conditions instead of running the same actions blindly.Documentation Index
Fetch the complete documentation index at: https://www.octoparse.com/docs/llms.txt
Use this file to discover all available pages before exploring further.
What it helps with
Smart decision logic can help with workflows where:- Some pages contain optional fields
- Some results have detail pages while others do not
- Buttons or pagination controls appear only in certain cases
- Popups or login states vary
- Different page layouts require different actions
- A task needs to skip unavailable elements
Example scenarios
| Scenario | Smart decision use |
|---|---|
| A “Next” button sometimes appears | Continue pagination only when the button exists |
| Some listings have detail pages | Click into details only when a link is present |
| A popup appears on some runs | Close it when detected, skip the step otherwise |
| Optional fields are missing | Continue extracting other fields without failing the workflow |
| Different page layouts appear | Use alternative actions depending on the page state |
How to use it
Define the condition
Decide what Octoparse should check, such as whether an element exists or whether a page state is present.
Set the action path
Configure what should happen when the condition is met and what should happen when it is not.
Best practices
- Use smart decisions only where the page genuinely varies.
- Keep conditions specific and easy to understand.
- Test both success and fallback paths.
- Avoid adding unnecessary branches to simple workflows.
- Recheck the task if the website layout changes.
Smart decision logic improves task resilience, but it does not replace testing. Always verify output across several page examples before running at scale.