RestrictedCrawlingContext <UserData>
Hierarchy
- RestrictedCrawlingContext
Index
Properties
addRequests
Type declaration
Parameters
requestsLike: readonly (string | ReadonlyObjectDeep<Partial<RequestOptions<Dictionary>> & { regex?: RegExp; requestsFromUrl?: string }> | ReadonlyObjectDeep<CrawleeRequest<Dictionary>>)[]
optionaloptions: ReadonlyObjectDeep<EnqueueUrlsOptions>
Options for the request queue
Returns Promise<AddRequestsBatchedResult>
getKeyValueStore
Get a key-value store with given name or id, or the default one for the crawler.
Type declaration
Parameters
optionalidentifier: string | StorageIdentifier
Returns Promise<Pick<KeyValueStore, id | name | getValue | getAutoSavedValue | setValue | getPublicUrl>>
id
log
A preconfigured logger for the request handler.
optionalproxyInfo
An object with information about currently used proxy by the crawler and configured by the ProxyConfiguration class.
request
The original Request object.
session
useState
Returns the state - a piece of mutable persistent data shared across all the request handler runs.
Type declaration
Parameters
optionaldefaultValue: State
Returns Promise<State>
Methods
pushData
This function allows you to push data to a Dataset specified by name, or the one currently used by the crawler.
Shortcut for
crawler.pushData().Parameters
optionaldata: ReadonlyDeep<Dictionary | Dictionary[]>
Data to be pushed to the default dataset.
optionaldatasetIdentifier: string | StorageIdentifier
Returns Promise<void>
Add requests directly to the request queue currently used by the crawler.
Optionally, the function allows you to filter the target URLs using an array of glob or regexp patterns, the same way
enqueueLinksdoes for extracted links.