Web Scrapers Generator BrowserExt


Filters an array or a dictionary in accordance with the specified value.

var = filter_value(data, type, str);


data An array or a dictionary, which is filtered.
type Filter type. Can be:
'equal' Equal to the string.
'notequal' Not equal to the string.
'regexp' Matches the regular expression.
'notregexp' Does not match the regular expression.
'condition' You can specify a logical expression with a variable $value, which corresponds to the value of a filtered array, for example, '$value > 20 && $value < 25'
str String or regular expression pattern.

Returned value: an array or a dictionary with only those elements of the data, the values of which correspond to the condition. Array won't be reindexed, i.e. key values are the same.

Example 1.