This is documentation for version 3.8. For the latest API, see version 3.12.
Version: 3.8
ProxyInfo
The main purpose of the ProxyInfo object is to provide information
about the current proxy connection used by the crawler for the request.
Outside of crawlers, you can get this object by calling ProxyConfiguration.newProxyInfo.
Example usage:
const proxyConfiguration =newProxyConfiguration({ proxyUrls:['...','...']// List of Proxy URLs to rotate }); // Getting proxyInfo object by calling class method directly const proxyInfo =await proxyConfiguration.newProxyInfo(); // In crawler const crawler =newCheerioCrawler({ // ... proxyConfiguration, requestHandler({ proxyInfo }){ // Getting used proxy URL const proxyUrl = proxyInfo.url; // Getting ID of used Session const sessionIdentifier = proxyInfo.sessionId; } })
The main purpose of the ProxyInfo object is to provide information about the current proxy connection used by the crawler for the request. Outside of crawlers, you can get this object by calling ProxyConfiguration.newProxyInfo.
Example usage: