mirror of
https://github.com/mendableai/firecrawl.git
synced 2024-11-16 11:42:24 +08:00
fix params
This commit is contained in:
parent
3edc3a3d15
commit
4d24a99d50
|
@ -52,6 +52,7 @@ export async function scrapWithFireEngine({
|
||||||
const waitParam = reqParams["params"]?.wait ?? waitFor;
|
const waitParam = reqParams["params"]?.wait ?? waitFor;
|
||||||
const engineParam = reqParams["params"]?.engine ?? reqParams["params"]?.fireEngineOptions?.engine ?? fireEngineOptions?.engine ?? "playwright";
|
const engineParam = reqParams["params"]?.engine ?? reqParams["params"]?.fireEngineOptions?.engine ?? fireEngineOptions?.engine ?? "playwright";
|
||||||
const screenshotParam = reqParams["params"]?.screenshot ?? screenshot;
|
const screenshotParam = reqParams["params"]?.screenshot ?? screenshot;
|
||||||
|
const fullPageScreenshotParam = reqParams["params"]?.fullPageScreenshot ?? fullPageScreenshot;
|
||||||
const fireEngineOptionsParam : FireEngineOptions = reqParams["params"]?.fireEngineOptions ?? fireEngineOptions;
|
const fireEngineOptionsParam : FireEngineOptions = reqParams["params"]?.fireEngineOptions ?? fireEngineOptions;
|
||||||
|
|
||||||
|
|
||||||
|
@ -64,7 +65,7 @@ export async function scrapWithFireEngine({
|
||||||
let engine = engineParam; // do we want fireEngineOptions as first choice?
|
let engine = engineParam; // do we want fireEngineOptions as first choice?
|
||||||
|
|
||||||
Logger.info(
|
Logger.info(
|
||||||
`⛏️ Fire-Engine (${engine}): Scraping ${url} | params: { wait: ${waitParam}, screenshot: ${screenshotParam}, method: ${fireEngineOptionsParam?.method ?? "null"} }`
|
`⛏️ Fire-Engine (${engine}): Scraping ${url} | params: { wait: ${waitParam}, screenshot: ${screenshotParam}, fullPageScreenshot: ${fullPageScreenshot}, method: ${fireEngineOptionsParam?.method ?? "null"} }`
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
@ -74,7 +75,7 @@ export async function scrapWithFireEngine({
|
||||||
url: url,
|
url: url,
|
||||||
wait: waitParam,
|
wait: waitParam,
|
||||||
screenshot: screenshotParam,
|
screenshot: screenshotParam,
|
||||||
fullPageScreenshot: fullPageScreenshot,
|
fullPageScreenshot: fullPageScreenshotParam,
|
||||||
headers: headers,
|
headers: headers,
|
||||||
pageOptions: pageOptions,
|
pageOptions: pageOptions,
|
||||||
...fireEngineOptionsParam,
|
...fireEngineOptionsParam,
|
||||||
|
|
|
@ -308,7 +308,7 @@ export async function scrapSingleUrl(
|
||||||
const scrapersInOrder = getScrapingFallbackOrder(
|
const scrapersInOrder = getScrapingFallbackOrder(
|
||||||
defaultScraper,
|
defaultScraper,
|
||||||
pageOptions && pageOptions.waitFor && pageOptions.waitFor > 0,
|
pageOptions && pageOptions.waitFor && pageOptions.waitFor > 0,
|
||||||
pageOptions && pageOptions.screenshot && pageOptions.screenshot === true,
|
pageOptions && (pageOptions.screenshot || pageOptions.fullPageScreenshot) && (pageOptions.screenshot === true || pageOptions.fullPageScreenshot === true),
|
||||||
pageOptions && pageOptions.headers && pageOptions.headers !== undefined
|
pageOptions && pageOptions.headers && pageOptions.headers !== undefined
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user