Input parameters

This article describes how to define input parameters within your scraper code and how to set the parameters when running the scraper.

 

Depending on your use case, you will have to choose whether to hardcode parameters within your code or to create more generic code by using inputs. For example, search terms, country codes, or languages. An input can be set from the control panel when initiating the scraper. 

 

Define an input parameter within your code

To create an input field scroll to the bottom of the IDE page, select the Input tab and add a new input parameter. 

Once the input is created, you can use it within your code.

For example:

let url = new URL(input.url);

 

Set an input parameter 

While developing the collector, you can set a value to an input parameter from the IDE interface, as shown above. 

Once the collector is developed and saved to production, you can set the parameters from the control panel when initiating the scraper. Whether you initiate manually or by API, the input fields will be available for you to set. You can add multiple parameters per input.

 

Initiate manually 

 

Initiate by API 

Was this article helpful?