mirror of
https://git.mirrors.martin98.com/https://github.com/mendableai/firecrawl
synced 2025-08-05 00:10:39 +08:00
minor fixes
This commit is contained in:
parent
20d1855ad5
commit
712ca31615
@ -591,7 +591,8 @@ export class WebScraperDataProvider {
|
|||||||
screenshot: options.pageOptions?.screenshot ?? false,
|
screenshot: options.pageOptions?.screenshot ?? false,
|
||||||
useFastMode: options.pageOptions?.useFastMode ?? false,
|
useFastMode: options.pageOptions?.useFastMode ?? false,
|
||||||
disableJsDom: options.pageOptions?.disableJsDom ?? false,
|
disableJsDom: options.pageOptions?.disableJsDom ?? false,
|
||||||
atsv: options.pageOptions?.atsv ?? false
|
atsv: options.pageOptions?.atsv ?? false,
|
||||||
|
actions: options.pageOptions?.actions ?? undefined,
|
||||||
};
|
};
|
||||||
this.extractorOptions = options.extractorOptions ?? { mode: "markdown" };
|
this.extractorOptions = options.extractorOptions ?? { mode: "markdown" };
|
||||||
this.replaceAllPathsWithAbsolutePaths =
|
this.replaceAllPathsWithAbsolutePaths =
|
||||||
|
@ -116,7 +116,7 @@ export async function scrapWithFireEngine({
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
const waitTotal = (actions ?? []).filter(x => x.type === "wait").reduce((a, x) => x.milliseconds + a, 0);
|
const waitTotal = (actions ?? []).filter(x => x.type === "wait").reduce((a, x) => (x as { type: "wait"; milliseconds: number; }).milliseconds + a, 0);
|
||||||
|
|
||||||
let checkStatusResponse = await axiosInstance.get(`${process.env.FIRE_ENGINE_BETA_URL}/scrape/${_response.data.jobId}`);
|
let checkStatusResponse = await axiosInstance.get(`${process.env.FIRE_ENGINE_BETA_URL}/scrape/${_response.data.jobId}`);
|
||||||
while (checkStatusResponse.data.processing && Date.now() - startTime < universalTimeout + waitTotal) {
|
while (checkStatusResponse.data.processing && Date.now() - startTime < universalTimeout + waitTotal) {
|
||||||
@ -141,7 +141,7 @@ export async function scrapWithFireEngine({
|
|||||||
|
|
||||||
if (checkStatusResponse.status !== 200 || checkStatusResponse.data.error) {
|
if (checkStatusResponse.status !== 200 || checkStatusResponse.data.error) {
|
||||||
Logger.debug(
|
Logger.debug(
|
||||||
`⛏️ Fire-Engine (${engine}): Failed to fetch url: ${url} \t status: ${checkStatusResponse.status}`
|
`⛏️ Fire-Engine (${engine}): Failed to fetch url: ${url} \t status: ${checkStatusResponse.status}\t ${checkStatusResponse.data.error}`
|
||||||
);
|
);
|
||||||
|
|
||||||
logParams.error_message = checkStatusResponse.data?.pageError ?? checkStatusResponse.data?.error;
|
logParams.error_message = checkStatusResponse.data?.pageError ?? checkStatusResponse.data?.error;
|
||||||
|
@ -153,7 +153,8 @@ export async function scrapSingleUrl(
|
|||||||
onlyIncludeTags: pageOptions.onlyIncludeTags ?? [],
|
onlyIncludeTags: pageOptions.onlyIncludeTags ?? [],
|
||||||
useFastMode: pageOptions.useFastMode ?? false,
|
useFastMode: pageOptions.useFastMode ?? false,
|
||||||
disableJsDom: pageOptions.disableJsDom ?? false,
|
disableJsDom: pageOptions.disableJsDom ?? false,
|
||||||
atsv: pageOptions.atsv ?? false
|
atsv: pageOptions.atsv ?? false,
|
||||||
|
actions: pageOptions.actions ?? undefined,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (extractorOptions) {
|
if (extractorOptions) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user