Config and Advanced Options
A monitor’s Config contains parameters in JSON format. The parameters are used to extract monitored content from a webpage.
How to view config?
You can navigate to the config of a monitor from the Options window. Here are the steps to view the config:
-
Click on the down caret icon for a Monitor to view quick action items.
-
Click on Edit Options. This opens the Options window.
-
Click the gear icon next to Open Webpage Selector and the config view opens. This contains page options, selected and deselected elements of your selector.
You have the option to edit your monitor configuration either in the Config view or with a Config JSON.
Config parameters
When a monitor is added, Distill creates a config automatically. Following are the parameters in the config with a default value. You can change the default value to match your requirements.
index: Generated by default. Its value is based on selection. For selection inside an iframe, the index should match with that of iframe’s index.excludes: List of selectors for excluded selections.includes: List of selectors for included selections.type: The selector type:css,xpath,jsorxcss. The default iscss.expr: Selector expression for the selected or excluded text.dynamic: Can be set to “true” or “false”. True value loads dynamic content of webpages while false does not.delay: Distill waits for the delay period before checking a page for a change. By default, this is set to 2. The value is in seconds. The Wait for duration field accepts 0 to 30.ignoreEmptyText: By default, this is set totrue. In this case, when the selected element does not contain any text, Distill registers an error with error code “SELECTION_EMPTY” in the error-log. If you would like to consider empty text as a change, set it tofalse.includeStyle: Set tofalseby default. If set totrue, Distill includes the webpage’s stylesheet in extracted data.incognito: If set totrue, the monitor runs in an Incognito tab. Only available for monitors that run in the Desktop app.blockAdsAndCookies: Blocks ads and cookie banners during the check. Only available for cloud monitors. On by default.solveCaptcha: If set totrue, Distill tries to solve a captcha it detects during the check. Only available for cloud monitors.regexp: Keeps only the text that matches a regular expression, withexprfor the expression andflagsfor its flags. The matches are joined with spaces. If nothing matches, the text is empty.
Page options
Page options, at the top of the config view, sets these options without editing the JSON:
- Wait for duration sets
delay. - Enable Javascript sets
dynamic. When you turn it off, the wait is set to 0. When you turn it back on, the previous wait comes back. - Incognito sets
incognito. - Include page styles sets
includeStyle. Turn it off for faster checks. The Styled option in Change History shows these styles when they are available. - Block ads and cookies sets
blockAdsAndCookies. Ads and cookie banners need JavaScript to appear, so this option matters only when Enable Javascript is on. - Auto solve captcha sets
solveCaptcha.
Set regexp in Regex Text Filter, below the selections. Its flags are gim by default.
How to wait for a page to finish loading before extracting content?
Sometimes, web pages or specific sections of a page may take longer to load. If monitored using the default settings, Distill may not be able to find the content during its check, resulting in incomplete or erroneous data. To address this issue, you can increase the delay setting in the monitor’s config. This will instruct Distill to wait for the specified delay time (in seconds) while the page’s content loads before checking it. You can test out with different delay values and check what works best for that page. You can add a delay either in the configuration UI or add it in the Config JSON.
Method 1: To set a delay in Configuration:
-
Click the gear icon next to the Open Webpage Selector button. The config view opens with Page options at the top.
-
Enter the delay in seconds in Wait for duration.
-
Click Save at the bottom of the options page.
Method 2: To set a delay with Config JSON:
-
In the config view, click the Config JSON tab. The config opens as JSON in an editor.
-
Find the
delayparameter, inside theselectionsentry:"delay": 2. It has a default value of 2 or 0 depending on the device. -
Change delay to a higher number, such as 10 or 12, and click Save at the bottom of the options page.
How to make changes in the config in bulk?
You can use the Batch Edit feature to update the config of multiple monitors at once.
Here are the steps to follow:
- Select the monitors for which you want to apply the new config.
- Click on Batch Edit → Config.
- Paste the new config and save.
All selected monitors must be of the same type. Otherwise, Distill shows “can’t batch update config of monitors of different content types”.
For the other options in Batch Edit, such as actions, schedule and device, see Batch Edit.