Share this page

# web.addAutoFilter

Sets criteria to include or exclude urls when downloading (applies to all subsequent action functions)

Example | Filter Functions

## Syntax

    web.addAutoFilter( {object} );

## JavaScript Object

    {
       action:"<string>",
       url:"<string>",
       urlPrefix:"<string>",
       host:"<string>",
       hostPrefix:"<string>",
       hostSuffix:"<string>",
       path:"<string>",
       pathPrefix:"<string>",
       pathSuffix:"<string>",
       port:"<string>",
       scheme:"<string>",
       query:"<string>",
       queryPrefix:"<string>",
       querySuffix:"<string>",
       fragmentId:"<string>",
       fragmentIdPrefix:"<string>",
       fragmentIdSuffix:"<string>",
       id: "<string>"
    }

Property Name | Description
--- | ---
action | A value indicating whether to include or exclude URLs matching the filter criteria. The following values are supported. – Include: include only URLs which match the criteria – Exclude: exclude URLss that match criteria. (default)
url | The specific URL to filter
urlPrefix | Filter all URLs that begin with this string. For example, "urlPrefix = http://www.cc" filters http://www.ccn.com, http://www.cc.edu, http://cc–nanochem.de, and any other URL that begins with "http://www.cc"
host | URLs which include host in the hostname portion of the URL path are filtered
hostPrefix | URLs which include this prefix in the hostname portion of the URL path are filtered
hostSuffix | URLs which include this suffix in the host name portion of the URL path are filtered
path | URLs with the specified path are filtered
pathPrefix | URLs with the specified path prefix are filtered
pathSuffix | URLs with the specified path suffix are filtered
port | URLs from the specified port are filtered
scheme | URLs with the specified communications scheme are filtered. Example schemes are http, https, and ftp
query | URLs with the specified query are filtered
queryPrefix | URLs with the specified query prefix are filtered
querySuffix | URLs with the specified query suffix are filtered
fragmentId | URLs containing a matching Fragment ID are filtered
fragmentIdPrefix | URLs containing a matching Fragment ID prefix are filtered
fragmentIdSuffix | URLs containing a matching Fragment ID suffix are filtered
id | An identifier for use by web.removeAutoFilter.

## Return Values

Not applicable

## Parameterization

All attributes from the list of attributes can be parameterized using standard parameterization.

## General Information

web.addAutoFilter specifies a filter to be used when downloading content for ensuing action functions. The filter is disabled when web.removeAutoFilter is invoked. Depending on the action attribute passed in this function, the filter will either include or exclude urls containing the matching criteria. The default action is "action=Exclude".

If the port attribute is set, then only content whose source is that port is downloaded. If no port is specified, then all ports are considered a match.

## Example

    web.addAutoFilter({action:'Exclude', pathPrefix:'/Images/Upload', id:"fid"})

Tips to improve your search results... VuGen Function Reference Version 25.1-25.3 Function Reference 25.1-25.3 All View Local Help Center View Online Help Center Version: