Supercharge your AI agents with data from the web and beyond. Building the library for superintelligence. 🔥
TypeScript aiai-agentsai-crawlerai-scrapingai-searchcrawlerdata-extractionhtml-to-markdownllmmarkdownscraperscrapingweb-crawlerweb-dataweb-data-extractionweb-scraperweb-scrapingweb-searchwebscraping
Update index.ts
Eric Ciarla32e814bedcc6
diff --git a/apps/api/src/scraper/WebScraper/index.ts b/apps/api/src/scraper/WebScraper/index.tsindex f432f430b..dfb52c476 100644--- a/apps/api/src/scraper/WebScraper/index.ts+++ b/apps/api/src/scraper/WebScraper/index.ts@@ -163,12 +163,15 @@ export class WebScraperDataProvider {inProgress?: (progress: Progress) => void): Promise<Document[]> {+ const baseURLDepth = new URL(this.urls[0]).pathname.split('/').length - 1;+ const adjustedMaxDepth = this.maxCrawledDepth + baseURLDepth;+const crawler = new WebCrawler({initialUrl: this.urls[0],includes: this.includes,excludes: this.excludes,maxCrawledLinks: this.maxCrawledLinks,- maxCrawledDepth: this.maxCrawledDepth,+ maxCrawledDepth: adjustedMaxDepth,limit: this.limit,generateImgAltText: this.generateImgAltText,allowBackwardCrawling: this.allowBackwardCrawling,