---
product: Chilkat
product_version: 11.7.0
language: sqlserver
language_label: SQL Server
class: Spider
license: free
deprecated: false
reference_html: https://www.chilkatsoft.com/refdoc/sqlserver_SpiderRef.html
---
# Chilkat Spider — SQL Server — v11.7.0

> Chilkat 11.7.0 · language=sqlserver · class=Spider
> Other versions: replace `11.7.0` in this URL. Other languages: `https://www.chilkatsoft.com/ai-docs/v/11.7.0/<lang>/classes/Spider.md`.
> Language-wide rules (install, unlock, error model, strings/bytes): `https://www.chilkatsoft.com/ai-docs/v/11.7.0/sqlserver/guide.md`.

## Purpose

**Crawl a website domain, manage URL queues, filter links, cache pages, and inspect fetched HTML.**

`Chilkat.Spider` crawls pages within a single initialized domain. It maintains internal lists of unspidered, spidered, failed, and outbound URLs; fetches one page at a time; extracts same-domain links for continued crawling; collects outbound links separately; respects `robots.txt`; supports wildcard include and avoid patterns; can use a dedicated cache directory; and exposes the last fetched HTML, title, meta description, keywords, redirect information, cache status, and last-modified date.

**Domain-limited crawling**

Initialize the spider with a domain and crawl only URLs that belong to that same domain.

**URL queue management**

Add starting URLs, crawl the next queued URL, skip selected URLs, and inspect unspidered, spidered, failed, and outbound URL lists.

**Filtering rules**

Add wildcard avoid patterns, must-match patterns, and outbound-link avoid patterns to control which URLs are crawled or collected.

**Page metadata**

Read the last fetched HTML, page title, meta description, meta keywords, final redirect URL, and last-modified timestamp.

**Caching and redirects**

Fetch pages from a Chilkat-managed cache, update the cache, detect when a page was redirected, and inspect whether the last page came from cache.

**Network controls**

Configure user-agent, proxy settings, connect/read timeouts, IPv6 preference, maximum URL length, maximum response size, and abort support.

**Common pattern:** Call `Initialize` with the target domain, add one or more starting URLs with `AddUnspidered`, optionally add filtering patterns, then repeatedly call `CrawlNext`. After each successful crawl, inspect `LastUrl`, `LastHtml`, page metadata, redirect state, and the URL-list counts to decide whether to continue, skip, recrawl, or process the page.

**Scope note:** `Spider` is intended for controlled, domain-oriented crawling and link discovery. Use `Chilkat.Http` or `Chilkat.Rest` when the task is a single HTTP request, API call, form post, or download rather than a crawl of discovered links.

## Object creation, unlocking and error handling

**Object Creation**

```sql
DECLARE @hr int
DECLARE @spider int
EXEC @hr = sp_OACreate 'Chilkat.Spider', @spider OUT
IF @hr <> 0
BEGIN
    PRINT 'Failed to create ActiveX component'
    RETURN
END

-- ... use @spider ...

EXEC @hr = sp_OADestroy @spider
```

T-SQL uses the Chilkat ActiveX through the OLE Automation stored procedures. They must be enabled once on the server (`EXEC sp_configure 'Ole Automation Procedures', 1; RECONFIGURE;`), and the Chilkat ActiveX registered must match the bitness of the SQL Server instance (64-bit for a 64-bit SQL Server). To bind to a specific major version of Chilkat, append the major version number to the ProgID, such as `sp_OACreate 'Chilkat.Spider.11'` for Chilkat v11.\*.\*.

`sp_OACreate` returns an object token (an `int`) that is passed as the first argument of every `sp_OAMethod`, `sp_OAGetProperty` and `sp_OASetProperty` call, and released with `sp_OADestroy`. Objects returned by methods (such as an `HttpResponse` or `JsonObject`) are also tokens received through an `int` OUT parameter; they must likewise be destroyed, and the OUT parameter is `NULL` when the method fails to return an object. Objects passed as arguments are passed by their token. When an OLE Automation procedure itself fails (non-zero `@hr`), `sp_OAGetErrorInfo` describes the error.

Data types: strings are `nvarchar(4000)`; integers, booleans (1 or 0) and object tokens are `int`; dates are `datetime`. In the signatures on this page, `@success`, `@iResult`, `@sResult` and the like are the OUT variables receiving a method's return value, `@iValue` / `@sValue` receive or supply a property value, and the remaining `@` variables are the method's arguments in order.

A string returned through an OUT parameter is limited to 4000 characters. For longer values, retrieve the result as a result set into a table variable instead of an OUT parameter, for example `DECLARE @tmp TABLE (outputLine ntext)` followed by `INSERT INTO @tmp EXEC sp_OAGetProperty @spider, 'LastErrorText'`. See [string length limitations for strings returned by sp_OAMethod calls](https://www.chilkatsoft.com/sql_server_nvarchar_max_limitation.asp).

Methods that pass or return raw byte arrays are not shown on this page, because `varbinary(max)` values cannot be exchanged through `sp_OAMethod` (see [varbinary(max) limitation](https://www.chilkatsoft.com/sql_server_varbinary_max_limitation.asp)). Use the `BinData`-based alternatives (methods ending in *Bd*) or the base64 / hex string-encoded variants instead. Binary *properties* (such as `LastBinaryResult`) can be retrieved as a result set into a table variable, as shown in their signatures. Asynchronous (*\*Async*) methods and event callbacks are not available from SQL Server.

Call `Global.UnlockBundle` once at the start of the program, before using this or any other Chilkat class. Any string unlocks a fully functional 30-day trial; a purchased unlock code is used in production. See `guide.md` for the exact code in SQL Server.

How failure is reported depends on the method's return type and is stated in the note under each method below. In every case the diagnostic text is in the `LastErrorText` property of the object whose method was called.

## Members common to every Chilkat class

Documented once per language in `common-members.md`; listed here so this page is self-contained.

| Property | Signature | Access | Meaning |
|---|---|---|---|
| `DebugLogFilePath` | `EXEC sp_OAGetProperty @spider, 'DebugLogFilePath', @sValue OUT EXEC sp_OASetProperty @spider, 'DebugLogFilePath', @sValue` | read/write | If set to a file path, this property logs the LastErrorText of each Chilkat method or property call to the specified file. |
| `LastBinaryResult` | `INSERT INTO @tmp EXEC sp_OAGetProperty @spider, 'LastBinaryResult'` | read-only | This property is mainly used in SQL Server stored procedures to retrieve binary data from the last method call that returned binary data. |
| `LastErrorHtml` | `EXEC sp_OAGetProperty @spider, 'LastErrorHtml', @sValue OUT` | read-only | Provides HTML-formatted information about the last called method or property. |
| `LastErrorText` | `EXEC sp_OAGetProperty @spider, 'LastErrorText', @sValue OUT` | read-only | Provides plain text information about the last called method or property. |
| `LastErrorXml` | `EXEC sp_OAGetProperty @spider, 'LastErrorXml', @sValue OUT` | read-only | Provides XML-formatted information about the last called method or property. |
| `LastMethodSuccess` | `EXEC sp_OAGetProperty @spider, 'LastMethodSuccess', @iValue OUT EXEC sp_OASetProperty @spider, 'LastMethodSuccess', @iValue` | read/write | Indicates the success or failure of the most recent method call: `1` means success, `0` means failure. |
| `LastStringResult` | `EXEC sp_OAGetProperty @spider, 'LastStringResult', @sValue OUT` | read-only | In SQL Server stored procedures, this property holds the string return value of the most recent method call that returns a string. |
| `LastStringResultLen` | `EXEC sp_OAGetProperty @spider, 'LastStringResultLen', @iValue OUT` | read-only | The length, in characters, of the string contained in the LastStringResult property. |
| `VerboseLogging` | `EXEC sp_OAGetProperty @spider, 'VerboseLogging', @iValue OUT EXEC sp_OASetProperty @spider, 'VerboseLogging', @iValue` | read/write | If set to `1`, then the contents of LastErrorText (or LastErrorXml, or LastErrorHtml) may contain more verbose information. |
| `Version` | `EXEC sp_OAGetProperty @spider, 'Version', @sValue OUT` | read-only | Version of the component/library, such as "10.1.0" |

## Member index

| Member | Kind | Signature |
|---|---|---|
| `AbortCurrent` | property, read/write | `EXEC sp_OAGetProperty @spider, 'AbortCurrent', @iValue OUT EXEC sp_OASetProperty @spider, 'AbortCurrent', @iValue` |
| `AvoidHttps` | property, read/write | `EXEC sp_OAGetProperty @spider, 'AvoidHttps', @iValue OUT EXEC sp_OASetProperty @spider, 'AvoidHttps', @iValue` |
| `CacheDir` | property, read/write | `EXEC sp_OAGetProperty @spider, 'CacheDir', @sValue OUT EXEC sp_OASetProperty @spider, 'CacheDir', @sValue` |
| `ChopAtQuery` | property, read/write | `EXEC sp_OAGetProperty @spider, 'ChopAtQuery', @iValue OUT EXEC sp_OASetProperty @spider, 'ChopAtQuery', @iValue` |
| `ConnectTimeout` | property, read/write | `EXEC sp_OAGetProperty @spider, 'ConnectTimeout', @iValue OUT EXEC sp_OASetProperty @spider, 'ConnectTimeout', @iValue` |
| `Domain` | property, read-only | `EXEC sp_OAGetProperty @spider, 'Domain', @sValue OUT` |
| `FetchFromCache` | property, read/write | `EXEC sp_OAGetProperty @spider, 'FetchFromCache', @iValue OUT EXEC sp_OASetProperty @spider, 'FetchFromCache', @iValue` |
| `FinalRedirectUrl` | property, read-only | `EXEC sp_OAGetProperty @spider, 'FinalRedirectUrl', @sValue OUT` |
| `LastFromCache` | property, read-only | `EXEC sp_OAGetProperty @spider, 'LastFromCache', @iValue OUT` |
| `LastHtml` | property, read-only | `EXEC sp_OAGetProperty @spider, 'LastHtml', @sValue OUT` |
| `LastHtmlDescription` | property, read-only | `EXEC sp_OAGetProperty @spider, 'LastHtmlDescription', @sValue OUT` |
| `LastHtmlKeywords` | property, read-only | `EXEC sp_OAGetProperty @spider, 'LastHtmlKeywords', @sValue OUT` |
| `LastHtmlTitle` | property, read-only | `EXEC sp_OAGetProperty @spider, 'LastHtmlTitle', @sValue OUT` |
| `LastUrl` | property, read-only | `EXEC sp_OAGetProperty @spider, 'LastUrl', @sValue OUT` |
| `MaxResponseSize` | property, read/write | `EXEC sp_OAGetProperty @spider, 'MaxResponseSize', @iValue OUT EXEC sp_OASetProperty @spider, 'MaxResponseSize', @iValue` |
| `MaxUrlLen` | property, read/write | `EXEC sp_OAGetProperty @spider, 'MaxUrlLen', @iValue OUT EXEC sp_OASetProperty @spider, 'MaxUrlLen', @iValue` |
| `NumAvoidPatterns` | property, read-only | `EXEC sp_OAGetProperty @spider, 'NumAvoidPatterns', @iValue OUT` |
| `NumFailed` | property, read-only | `EXEC sp_OAGetProperty @spider, 'NumFailed', @iValue OUT` |
| `NumOutboundLinks` | property, read-only | `EXEC sp_OAGetProperty @spider, 'NumOutboundLinks', @iValue OUT` |
| `NumSpidered` | property, read-only | `EXEC sp_OAGetProperty @spider, 'NumSpidered', @iValue OUT` |
| `NumUnspidered` | property, read-only | `EXEC sp_OAGetProperty @spider, 'NumUnspidered', @iValue OUT` |
| `PreferIpv6` | property, read/write | `EXEC sp_OAGetProperty @spider, 'PreferIpv6', @iValue OUT EXEC sp_OASetProperty @spider, 'PreferIpv6', @iValue` |
| `ProxyDomain` | property, read/write | `EXEC sp_OAGetProperty @spider, 'ProxyDomain', @sValue OUT EXEC sp_OASetProperty @spider, 'ProxyDomain', @sValue` |
| `ProxyLogin` | property, read/write | `EXEC sp_OAGetProperty @spider, 'ProxyLogin', @sValue OUT EXEC sp_OASetProperty @spider, 'ProxyLogin', @sValue` |
| `ProxyPassword` | property, read/write | `EXEC sp_OAGetProperty @spider, 'ProxyPassword', @sValue OUT EXEC sp_OASetProperty @spider, 'ProxyPassword', @sValue` |
| `ProxyPort` | property, read/write | `EXEC sp_OAGetProperty @spider, 'ProxyPort', @iValue OUT EXEC sp_OASetProperty @spider, 'ProxyPort', @iValue` |
| `ReadTimeout` | property, read/write | `EXEC sp_OAGetProperty @spider, 'ReadTimeout', @iValue OUT EXEC sp_OASetProperty @spider, 'ReadTimeout', @iValue` |
| `UpdateCache` | property, read/write | `EXEC sp_OAGetProperty @spider, 'UpdateCache', @iValue OUT EXEC sp_OASetProperty @spider, 'UpdateCache', @iValue` |
| `UserAgent` | property, read/write | `EXEC sp_OAGetProperty @spider, 'UserAgent', @sValue OUT EXEC sp_OASetProperty @spider, 'UserAgent', @sValue` |
| `WasRedirected` | property, read-only | `EXEC sp_OAGetProperty @spider, 'WasRedirected', @iValue OUT` |
| `WindDownCount` | property, read/write | `EXEC sp_OAGetProperty @spider, 'WindDownCount', @iValue OUT EXEC sp_OASetProperty @spider, 'WindDownCount', @iValue` |
| `AddAvoidOutboundLinkPattern` | method | `EXEC sp_OAMethod @spider, 'AddAvoidOutboundLinkPattern', NULL, @pattern` |
| `AddAvoidPattern` | method | `EXEC sp_OAMethod @spider, 'AddAvoidPattern', NULL, @pattern` |
| `AddMustMatchPattern` | method | `EXEC sp_OAMethod @spider, 'AddMustMatchPattern', NULL, @pattern` |
| `AddUnspidered` | method | `EXEC sp_OAMethod @spider, 'AddUnspidered', NULL, @url` |
| `CanonicalizeUrl` | method | `EXEC sp_OAMethod @spider, 'CanonicalizeUrl', @sResult OUT, @url` |
| `ClearFailedUrls` | method | `EXEC sp_OAMethod @spider, 'ClearFailedUrls', NULL` |
| `ClearOutboundLinks` | method | `EXEC sp_OAMethod @spider, 'ClearOutboundLinks', NULL` |
| `ClearSpideredUrls` | method | `EXEC sp_OAMethod @spider, 'ClearSpideredUrls', NULL` |
| `CrawlNext` | method | `EXEC sp_OAMethod @spider, 'CrawlNext', @success OUT` |
| `FetchRobotsText` | method | `EXEC sp_OAMethod @spider, 'FetchRobotsText', @sResult OUT` |
| `GetAvoidPattern` | method | `EXEC sp_OAMethod @spider, 'GetAvoidPattern', @sResult OUT, @index` |
| `GetBaseDomain` | method | `EXEC sp_OAMethod @spider, 'GetBaseDomain', @sResult OUT, @domain` |
| `GetFailedUrl` | method | `EXEC sp_OAMethod @spider, 'GetFailedUrl', @sResult OUT, @index` |
| `GetOutboundLink` | method | `EXEC sp_OAMethod @spider, 'GetOutboundLink', @sResult OUT, @index` |
| `GetSpideredUrl` | method | `EXEC sp_OAMethod @spider, 'GetSpideredUrl', @sResult OUT, @index` |
| `GetUnspideredUrl` | method | `EXEC sp_OAMethod @spider, 'GetUnspideredUrl', @sResult OUT, @index` |
| `GetUrlDomain` | method | `EXEC sp_OAMethod @spider, 'GetUrlDomain', @sResult OUT, @url` |
| `Initialize` | method | `EXEC sp_OAMethod @spider, 'Initialize', NULL, @domain` |
| `RecrawlLast` | method | `EXEC sp_OAMethod @spider, 'RecrawlLast', @success OUT` |
| `SkipUnspidered` | method | `EXEC sp_OAMethod @spider, 'SkipUnspidered', NULL, @index` |
| `SleepMs` | method | `EXEC sp_OAMethod @spider, 'SleepMs', NULL, @numMilliseconds` |

## Properties

### Spider.AbortCurrent

`Chilkat 11.7.0 · sqlserver · Spider · AbortCurrent · property · read/write · since 9.5.0.58`

```sql
EXEC sp_OAGetProperty @spider, 'AbortCurrent', @iValue OUT
EXEC sp_OASetProperty @spider, 'AbortCurrent', @iValue
```

When set to `1`, causes the currently running method to abort. Methods that always finish quickly (i.e.have no length file operations or network communications) are not affected. If no method is running, then this property is automatically reset to `0` when the next method is called. When the abort occurs, this property is reset to `0`. Both synchronous and asynchronous method calls can be aborted. (A synchronous method call could be aborted by setting this property from a separate thread.)

### Spider.AvoidHttps

`Chilkat 11.7.0 · sqlserver · Spider · AvoidHttps · property · read/write`

```sql
EXEC sp_OAGetProperty @spider, 'AvoidHttps', @iValue OUT
EXEC sp_OASetProperty @spider, 'AvoidHttps', @iValue
```

If set the 1 (true) the spider will avoid all HTTPS URLs. The default is 0 (false).

### Spider.CacheDir

`Chilkat 11.7.0 · sqlserver · Spider · CacheDir · property · read/write`

```sql
EXEC sp_OAGetProperty @spider, 'CacheDir', @sValue OUT
EXEC sp_OASetProperty @spider, 'CacheDir', @sValue
```

Specifies a cache directory to use for spidering. If either of the FetchFromCache or UpdateCache properties are true, this is the location of the cache to be used. Note: the Internet Explorer, Netscape, and FireFox caches are completely separate from the Chilkat Spider cache directory. You should specify a new and empty directory.

### Spider.ChopAtQuery

`Chilkat 11.7.0 · sqlserver · Spider · ChopAtQuery · property · read/write`

```sql
EXEC sp_OAGetProperty @spider, 'ChopAtQuery', @iValue OUT
EXEC sp_OASetProperty @spider, 'ChopAtQuery', @iValue
```

If equal to 1 (true), then the query portion of all URLs are automatically removed when adding to the unspidered list. The default value is 0 (false).

### Spider.ConnectTimeout

`Chilkat 11.7.0 · sqlserver · Spider · ConnectTimeout · property · read/write`

```sql
EXEC sp_OAGetProperty @spider, 'ConnectTimeout', @iValue OUT
EXEC sp_OASetProperty @spider, 'ConnectTimeout', @iValue
```

The maximum number of seconds to wait while connecting to an HTTP server.

### Spider.Domain

`Chilkat 11.7.0 · sqlserver · Spider · Domain · property · read-only`

```sql
EXEC sp_OAGetProperty @spider, 'Domain', @sValue OUT
```

The domain name that is being spidered. This is the domain previously set in the Initialize method.

### Spider.FetchFromCache

`Chilkat 11.7.0 · sqlserver · Spider · FetchFromCache · property · read/write`

```sql
EXEC sp_OAGetProperty @spider, 'FetchFromCache', @iValue OUT
EXEC sp_OASetProperty @spider, 'FetchFromCache', @iValue
```

If equal to 1 (true) then pages are fetched from cache when possible. If 0, the cache is ignored. The default value is 1. Regardless, if no CacheDir is set then the cache is not used.

### Spider.FinalRedirectUrl

`Chilkat 11.7.0 · sqlserver · Spider · FinalRedirectUrl · property · read-only · since 9.5.0.85`

```sql
EXEC sp_OAGetProperty @spider, 'FinalRedirectUrl', @sValue OUT
```

If the last URL crawled was redirected (as indicated by the WasRedirected property), this property will contain the final redirect URL.

### Spider.LastFromCache

`Chilkat 11.7.0 · sqlserver · Spider · LastFromCache · property · read-only`

```sql
EXEC sp_OAGetProperty @spider, 'LastFromCache', @iValue OUT
```

Equal to 1 if the last page spidered was fetched from the cache. Otherwise equal to 0.

### Spider.LastHtml

`Chilkat 11.7.0 · sqlserver · Spider · LastHtml · property · read-only`

```sql
EXEC sp_OAGetProperty @spider, 'LastHtml', @sValue OUT
```

The HTML text of the last paged fetched by the spider.

### Spider.LastHtmlDescription

`Chilkat 11.7.0 · sqlserver · Spider · LastHtmlDescription · property · read-only`

```sql
EXEC sp_OAGetProperty @spider, 'LastHtmlDescription', @sValue OUT
```

The HTML META description from the last page fetched by the spider.

### Spider.LastHtmlKeywords

`Chilkat 11.7.0 · sqlserver · Spider · LastHtmlKeywords · property · read-only`

```sql
EXEC sp_OAGetProperty @spider, 'LastHtmlKeywords', @sValue OUT
```

The HTML META keywords from the last page fetched by the spider.

### Spider.LastHtmlTitle

`Chilkat 11.7.0 · sqlserver · Spider · LastHtmlTitle · property · read-only`

```sql
EXEC sp_OAGetProperty @spider, 'LastHtmlTitle', @sValue OUT
```

The HTML title from the last page fetched by the spider.

### Spider.LastUrl

`Chilkat 11.7.0 · sqlserver · Spider · LastUrl · property · read-only`

```sql
EXEC sp_OAGetProperty @spider, 'LastUrl', @sValue OUT
```

The URL of the last page spidered.

### Spider.MaxResponseSize

`Chilkat 11.7.0 · sqlserver · Spider · MaxResponseSize · property · read/write`

```sql
EXEC sp_OAGetProperty @spider, 'MaxResponseSize', @iValue OUT
EXEC sp_OASetProperty @spider, 'MaxResponseSize', @iValue
```

The maximum HTTP response size allowed. The spider will automatically fail any pages larger than this size. The default value is 250,000 bytes.

### Spider.MaxUrlLen

`Chilkat 11.7.0 · sqlserver · Spider · MaxUrlLen · property · read/write`

```sql
EXEC sp_OAGetProperty @spider, 'MaxUrlLen', @iValue OUT
EXEC sp_OASetProperty @spider, 'MaxUrlLen', @iValue
```

The maximum URL length allowed. URLs longer than this are not added to the unspidered list. The default value is 200.

### Spider.NumAvoidPatterns

`Chilkat 11.7.0 · sqlserver · Spider · NumAvoidPatterns · property · read-only`

```sql
EXEC sp_OAGetProperty @spider, 'NumAvoidPatterns', @iValue OUT
```

The number of avoid patterns previously set by calling AddAvoidPattern.

### Spider.NumFailed

`Chilkat 11.7.0 · sqlserver · Spider · NumFailed · property · read-only`

```sql
EXEC sp_OAGetProperty @spider, 'NumFailed', @iValue OUT
```

The number of URLs in the object's failed URL list.

### Spider.NumOutboundLinks

`Chilkat 11.7.0 · sqlserver · Spider · NumOutboundLinks · property · read-only`

```sql
EXEC sp_OAGetProperty @spider, 'NumOutboundLinks', @iValue OUT
```

The number of URLs in the object's outbound links URL list.

### Spider.NumSpidered

`Chilkat 11.7.0 · sqlserver · Spider · NumSpidered · property · read-only`

```sql
EXEC sp_OAGetProperty @spider, 'NumSpidered', @iValue OUT
```

The number of URLs in the object's already-spidered URL list.

### Spider.NumUnspidered

`Chilkat 11.7.0 · sqlserver · Spider · NumUnspidered · property · read-only`

```sql
EXEC sp_OAGetProperty @spider, 'NumUnspidered', @iValue OUT
```

The number of URLs in the object's unspidered URL list.

### Spider.PreferIpv6

`Chilkat 11.7.0 · sqlserver · Spider · PreferIpv6 · property · read/write`

```sql
EXEC sp_OAGetProperty @spider, 'PreferIpv6', @iValue OUT
EXEC sp_OASetProperty @spider, 'PreferIpv6', @iValue
```

If `1`, then use IPv6 over IPv4 when both are supported for a particular domain. The default value of this property is `0`, which will choose IPv4 over IPv6.

### Spider.ProxyDomain

`Chilkat 11.7.0 · sqlserver · Spider · ProxyDomain · property · read/write`

```sql
EXEC sp_OAGetProperty @spider, 'ProxyDomain', @sValue OUT
EXEC sp_OASetProperty @spider, 'ProxyDomain', @sValue
```

The domain name of a proxy host if an HTTP proxy is used.

### Spider.ProxyLogin

`Chilkat 11.7.0 · sqlserver · Spider · ProxyLogin · property · read/write`

```sql
EXEC sp_OAGetProperty @spider, 'ProxyLogin', @sValue OUT
EXEC sp_OASetProperty @spider, 'ProxyLogin', @sValue
```

If an HTTP proxy is used and it requires authentication, this property specifies the HTTP proxy login.

### Spider.ProxyPassword

`Chilkat 11.7.0 · sqlserver · Spider · ProxyPassword · property · read/write`

```sql
EXEC sp_OAGetProperty @spider, 'ProxyPassword', @sValue OUT
EXEC sp_OASetProperty @spider, 'ProxyPassword', @sValue
```

If an HTTP proxy is used and it requires authentication, this property specifies the HTTP proxy password.

### Spider.ProxyPort

`Chilkat 11.7.0 · sqlserver · Spider · ProxyPort · property · read/write`

```sql
EXEC sp_OAGetProperty @spider, 'ProxyPort', @iValue OUT
EXEC sp_OASetProperty @spider, 'ProxyPort', @iValue
```

The port number of a proxy server if an HTTP proxy is used.

### Spider.ReadTimeout

`Chilkat 11.7.0 · sqlserver · Spider · ReadTimeout · property · read/write`

```sql
EXEC sp_OAGetProperty @spider, 'ReadTimeout', @iValue OUT
EXEC sp_OASetProperty @spider, 'ReadTimeout', @iValue
```

The maximum number of seconds to wait when reading from an HTTP server.

### Spider.UpdateCache

`Chilkat 11.7.0 · sqlserver · Spider · UpdateCache · property · read/write`

```sql
EXEC sp_OAGetProperty @spider, 'UpdateCache', @iValue OUT
EXEC sp_OASetProperty @spider, 'UpdateCache', @iValue
```

If equal to 1 (true) then pages saved to the cache. If 0, the cache is ignored. The default value is 1. Regardless, if no CacheDir is set then the cache is not used.

### Spider.UserAgent

`Chilkat 11.7.0 · sqlserver · Spider · UserAgent · property · read/write`

```sql
EXEC sp_OAGetProperty @spider, 'UserAgent', @sValue OUT
EXEC sp_OASetProperty @spider, 'UserAgent', @sValue
```

The value of the HTTP user-agent header field to be sent with HTTP requests. This can be set to any desired value, but be aware that some websites may reject requests from unknown user agents.

### Spider.WasRedirected

`Chilkat 11.7.0 · sqlserver · Spider · WasRedirected · property · read-only · since 9.5.0.85`

```sql
EXEC sp_OAGetProperty @spider, 'WasRedirected', @iValue OUT
```

Indicates whether the last URL crawled was redirected. (`1` = yes, `0` = no)

### Spider.WindDownCount

`Chilkat 11.7.0 · sqlserver · Spider · WindDownCount · property · read/write`

```sql
EXEC sp_OAGetProperty @spider, 'WindDownCount', @iValue OUT
EXEC sp_OASetProperty @spider, 'WindDownCount', @iValue
```

The `wind-down` phase begins when this number of URLs has been spidered. When in the wind-down phase, no new URLs are added to the unspidered list. The default value is 0 which means that there is NO wind-down phase.

## Methods

### Spider.AddAvoidOutboundLinkPattern

`Chilkat 11.7.0 · sqlserver · Spider · AddAvoidOutboundLinkPattern · method`

```sql
EXEC sp_OAMethod @spider, 'AddAvoidOutboundLinkPattern', NULL, @pattern
```

Adds a wildcarded pattern to prevent collecting matching outbound link URLs. For example, if `*google*` is added, then any outbound links containing the word `google` will be ignored. The `*` character matches zero or more of any character.

### Spider.AddAvoidPattern

`Chilkat 11.7.0 · sqlserver · Spider · AddAvoidPattern · method`

```sql
EXEC sp_OAMethod @spider, 'AddAvoidPattern', NULL, @pattern
```

Adds a wildcarded pattern to prevent spidering matching URLs. For example, if `*register*` is added, then any url containing the word `register` is not spidered. The `*` character matches zero or more of any character.

### Spider.AddMustMatchPattern

`Chilkat 11.7.0 · sqlserver · Spider · AddMustMatchPattern · method`

```sql
EXEC sp_OAMethod @spider, 'AddMustMatchPattern', NULL, @pattern
```

Adds a wildcarded pattern to limit spidering to only URLs that match the pattern. For example, if `*/products/*` is added, then only URLs containing `/products/` are spidered. This is helpful for only spidering a portion of a website. The `*` character matches zero or more of any character.

### Spider.AddUnspidered

`Chilkat 11.7.0 · sqlserver · Spider · AddUnspidered · method`

```sql
EXEC sp_OAMethod @spider, 'AddUnspidered', NULL, @url
```

To begin spidering you must call this method one or more times to provide starting points. It adds a single URL to the object's internal queue of URLs to be spidered.

### Spider.CanonicalizeUrl

`Chilkat 11.7.0 · sqlserver · Spider · CanonicalizeUrl · method`

```sql
EXEC sp_OAMethod @spider, 'CanonicalizeUrl', @sResult OUT, @url
```

Canonicalizes a URL by doing the following:

- Drops username/password if present.
- Drops fragment if present.
- Converts domain to lowercase.
- Removes port 80 or 443
- Remove default.asp, index.html, index.htm, default.html, index.htm, default.htm, index.php, index.asp, default.php, .cfm, .aspx, ,php3, .pl, .cgi, .txt, .shtml, .phtml
- Remove www. from the domain if present.

Returns `NULL` on failure

### Spider.ClearFailedUrls

`Chilkat 11.7.0 · sqlserver · Spider · ClearFailedUrls · method`

```sql
EXEC sp_OAMethod @spider, 'ClearFailedUrls', NULL
```

Clears the object's internal list of URLs that could not be downloaded.

### Spider.ClearOutboundLinks

`Chilkat 11.7.0 · sqlserver · Spider · ClearOutboundLinks · method`

```sql
EXEC sp_OAMethod @spider, 'ClearOutboundLinks', NULL
```

Clears the object's internal list of outbound URLs that will automatically accumulate while spidering.

### Spider.ClearSpideredUrls

`Chilkat 11.7.0 · sqlserver · Spider · ClearSpideredUrls · method`

```sql
EXEC sp_OAMethod @spider, 'ClearSpideredUrls', NULL
```

Clears the object's internal list of already-spidered URLs that will automatically accumulate while spidering.

### Spider.CrawlNext

`Chilkat 11.7.0 · sqlserver · Spider · CrawlNext · method`

```sql
EXEC sp_OAMethod @spider, 'CrawlNext', @success OUT
```

Crawls the next URL in the internal list of unspidered URLs. The URL is moved from the unspidered list to the spidered list. Any new links within the same domain and not yet spidered are added to the unspidered list. (providing that they do not match `avoid` patterns, etc.) Any new outbound links are added to the outbound URL list. If successful, the HTML of the downloaded page is available in the LastHtml property. If there are no more URLs left unspidered, the method returns `0`. Information about the URL crawled is available in the properties LastUrl, LastFromCache, and LastModDate.

### Spider.FetchRobotsText

`Chilkat 11.7.0 · sqlserver · Spider · FetchRobotsText · method`

```sql
EXEC sp_OAMethod @spider, 'FetchRobotsText', @sResult OUT
```

Returns the contents of the robots.txt file from the domain being crawled. This spider object will not crawl URLs excluded by robots.txt. If you believe the spider is not behaving correctly, please notify us at support@chilkatsoft.com and provide information detailing a case that allows us to reproduce the problem.

Returns `NULL` on failure

### Spider.GetAvoidPattern

`Chilkat 11.7.0 · sqlserver · Spider · GetAvoidPattern · method`

```sql
EXEC sp_OAMethod @spider, 'GetAvoidPattern', @sResult OUT, @index
```

Returns the Nth avoid pattern previously added by calling AddAvoidPattern. Indexing begins at 0.

Returns `NULL` on failure

### Spider.GetBaseDomain

`Chilkat 11.7.0 · sqlserver · Spider · GetBaseDomain · method`

```sql
EXEC sp_OAMethod @spider, 'GetBaseDomain', @sResult OUT, @domain
```

Returns the second-level + top-level domain of the `domain`. For example, if `domain` is `xyz.example.com`, this returns `example.com`. For some domains, such as `xyz.example.co.uk`, the top 3 levels are returned, such as `example.co.uk`.

Returns `NULL` on failure

### Spider.GetFailedUrl

`Chilkat 11.7.0 · sqlserver · Spider · GetFailedUrl · method`

```sql
EXEC sp_OAMethod @spider, 'GetFailedUrl', @sResult OUT, @index
```

Returns the Nth URL in the failed URL list. Indexing begins at 0.

Returns `NULL` on failure

### Spider.GetOutboundLink

`Chilkat 11.7.0 · sqlserver · Spider · GetOutboundLink · method`

```sql
EXEC sp_OAMethod @spider, 'GetOutboundLink', @sResult OUT, @index
```

Returns the Nth URL in the outbound link URL list. Indexing begins at 0.

Returns `NULL` on failure

### Spider.GetSpideredUrl

`Chilkat 11.7.0 · sqlserver · Spider · GetSpideredUrl · method`

```sql
EXEC sp_OAMethod @spider, 'GetSpideredUrl', @sResult OUT, @index
```

Returns the Nth URL in the already-spidered URL list. Indexing begins at 0.

Returns `NULL` on failure

### Spider.GetUnspideredUrl

`Chilkat 11.7.0 · sqlserver · Spider · GetUnspideredUrl · method`

```sql
EXEC sp_OAMethod @spider, 'GetUnspideredUrl', @sResult OUT, @index
```

Returns the Nth URL in the unspidered URL list. Indexing begins at 0.

Returns `NULL` on failure

### Spider.GetUrlDomain

`Chilkat 11.7.0 · sqlserver · Spider · GetUrlDomain · method`

```sql
EXEC sp_OAMethod @spider, 'GetUrlDomain', @sResult OUT, @url
```

Returns the domain name part of a URL. For example, if the URL is `https://www.chilkatsoft.com/test.asp`, then `www.chilkatsoft.com` is returned.

Returns `NULL` on failure

### Spider.Initialize

`Chilkat 11.7.0 · sqlserver · Spider · Initialize · method`

```sql
EXEC sp_OAMethod @spider, 'Initialize', NULL, @domain
```

Initializes the object to begin spidering a domain. Calling Initialize clears any patterns added via the AddAvoidOutboundLinkPattern, AddAvoidPattern, and AddMustMatchPattern methods. The domain name passed to this method is what is returned by the Domain property. The spider only crawls URLs within the same domain.

### Spider.RecrawlLast

`Chilkat 11.7.0 · sqlserver · Spider · RecrawlLast · method`

```sql
EXEC sp_OAMethod @spider, 'RecrawlLast', @success OUT
```

Re-crawls the last URL spidered. This helpful when cookies set in a previous page load cause the page to be loaded differently the next time.

### Spider.SkipUnspidered

`Chilkat 11.7.0 · sqlserver · Spider · SkipUnspidered · method`

```sql
EXEC sp_OAMethod @spider, 'SkipUnspidered', NULL, @index
```

Moves a URL from the unspidered list to the spidered list. This allows an application to skip a specific URL.

### Spider.SleepMs

`Chilkat 11.7.0 · sqlserver · Spider · SleepMs · method`

```sql
EXEC sp_OAMethod @spider, 'SleepMs', NULL, @numMilliseconds
```

Suspends the execution of the current thread until the time-out interval elapses.

## Events and callbacks

This binding has no event callbacks.

