Update single_url.ts
This commit is contained in:
parent
d8ee4e90d6
commit
68838c9e0d
@ -20,12 +20,17 @@ export async function generateRequestParams(
|
|||||||
headers: { "ScrapingService-Request": "TRUE" },
|
headers: { "ScrapingService-Request": "TRUE" },
|
||||||
};
|
};
|
||||||
|
|
||||||
|
try {
|
||||||
const urlKey = new URL(url).hostname;
|
const urlKey = new URL(url).hostname;
|
||||||
if (urlSpecificParams.hasOwnProperty(urlKey)) {
|
if (urlSpecificParams.hasOwnProperty(urlKey)) {
|
||||||
return { ...defaultParams, ...urlSpecificParams[urlKey] };
|
return { ...defaultParams, ...urlSpecificParams[urlKey] };
|
||||||
} else {
|
} else {
|
||||||
return defaultParams;
|
return defaultParams;
|
||||||
}
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error(`Error generating URL key: ${error}`);
|
||||||
|
return defaultParams;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
export async function scrapWithCustomFirecrawl(
|
export async function scrapWithCustomFirecrawl(
|
||||||
url: string,
|
url: string,
|
||||||
|
Loading…
Reference in New Issue
Block a user