Include external configuration processor
Core v2.2.0
The
processor imports and executes external WebHarvest configuration
files, enabling modular scraper design, code reuse, and separation of concerns.
Included configurations execute in the same context, sharing variables and state.
<!-- main.xml -->
<config>
<!-- Import shared functions -->
<include path="functions/http-helpers.xml"/>
<include path="functions/data-extractors.xml"/>
<!-- Use imported functions -->
<call name="fetchAndParse">
<call-param name="url">https://example.com</call-param>
</call>
</config>
<!-- main.xml -->
<config>
<include path="config/constants.xml"/> <!-- API keys, URLs -->
<include path="scrapers/products.xml"/> <!-- Product scraping logic -->
<include path="scrapers/reviews.xml"/> <!-- Review scraping logic -->
<include path="export/formatters.xml"/> <!-- Export functions -->
</config>
<?xml version="1.0" encoding="UTF-8"?>
<config xmlns="http://org.webharvest/schema/2.1/core">
<def var="environment" value="production"/>
<if condition="${environment == 'production'}">
<include path="config/prod-settings.xml"/>
</if>
<else>
<include path="config/dev-settings.xml"/>
</else>
</config>