MCPcopy Index your code
hub / github.com/FlowiseAI/Flowise / getURLsFromXML

Function getURLsFromXML

packages/components/src/utils.ts:494–506  ·  view source on GitHub ↗
(xmlBody: string, limit: number)

Source from the content-addressed store, hash-verified

492}
493
494export function getURLsFromXML(xmlBody: string, limit: number): string[] {
495 const dom = new JSDOM(xmlBody, { contentType: 'text/xml' })
496 const linkElements = dom.window.document.querySelectorAll('url')
497 const urls: string[] = []
498 for (const linkElement of linkElements) {
499 const locElement = linkElement.querySelector('loc')
500 if (limit !== 0 && urls.length === limit) break
501 if (locElement?.textContent) {
502 urls.push(locElement.textContent)
503 }
504 }
505 return urls
506}
507
508export async function xmlScrape(currentURL: string, limit: number): Promise<string[]> {
509 let urls: string[] = []

Callers 1

xmlScrapeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected