mirror of
https://github.com/farcasclaudiu/Flowise.git
synced 2026-06-28 17:01:00 +03:00
Bugfix/Web Scraper Limit (#2083)
fix when limit set to 0, selectedLinks sliced to become empty
This commit is contained in:
@@ -132,7 +132,7 @@ class Cheerio_DocumentLoaders implements INode {
|
||||
else if (limit < 0) throw new Error('Limit cannot be less than 0')
|
||||
const pages: string[] =
|
||||
selectedLinks && selectedLinks.length > 0
|
||||
? selectedLinks.slice(0, limit)
|
||||
? selectedLinks.slice(0, limit === 0 ? undefined : limit)
|
||||
: relativeLinksMethod === 'webCrawl'
|
||||
? await webCrawl(url, limit)
|
||||
: await xmlScrape(url, limit)
|
||||
|
||||
@@ -173,7 +173,7 @@ class Playwright_DocumentLoaders implements INode {
|
||||
else if (limit < 0) throw new Error('Limit cannot be less than 0')
|
||||
const pages: string[] =
|
||||
selectedLinks && selectedLinks.length > 0
|
||||
? selectedLinks.slice(0, limit)
|
||||
? selectedLinks.slice(0, limit === 0 ? undefined : limit)
|
||||
: relativeLinksMethod === 'webCrawl'
|
||||
? await webCrawl(url, limit)
|
||||
: await xmlScrape(url, limit)
|
||||
|
||||
@@ -174,7 +174,7 @@ class Puppeteer_DocumentLoaders implements INode {
|
||||
else if (limit < 0) throw new Error('Limit cannot be less than 0')
|
||||
const pages: string[] =
|
||||
selectedLinks && selectedLinks.length > 0
|
||||
? selectedLinks.slice(0, limit)
|
||||
? selectedLinks.slice(0, limit === 0 ? undefined : limit)
|
||||
: relativeLinksMethod === 'webCrawl'
|
||||
? await webCrawl(url, limit)
|
||||
: await xmlScrape(url, limit)
|
||||
|
||||
Reference in New Issue
Block a user