A ready-to-use web spider that works with proxies, asynchrony, rate limit, configurable request pools, jQuery, and HTTP/2 support.
94
Build a web scraper that checks product availability across multiple regional e-commerce endpoints. Each region has different rate limiting requirements that must be respected to avoid being blocked.
Your system must scrape product availability information from multiple regional endpoints (simulated as different URLs). Each region has its own rate limiting policy:
The scraper should:
@generates
/**
* Creates and configures a multi-region product scraper.
*
* @param {Object} config - Configuration for the scraper
* @param {Array<Object>} config.regions - Array of region configurations
* @param {string} config.regions[].name - Region identifier
* @param {number} config.regions[].rateLimit - Minimum milliseconds between requests for this region
* @param {string} config.regions[].proxy - Proxy URL for this region (optional)
* @returns {Object} Scraper instance with methods to add tasks and handle completion
*/
function createScraper(config) {
// Returns an object with:
// - addTask(regionName, url, callback): adds a scraping task for a specific region
// - onComplete(callback): registers a callback for when all tasks finish
// - start(): begins processing the queue
}
module.exports = { createScraper };Provides web scraping capabilities with rate limiting and queue management.
@satisfied-by
Install with Tessl CLI
npx tessl i tessl/npm-crawlerevals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10