mirror of
https://github.com/mendableai/firecrawl.git
synced 2024-11-16 11:42:24 +08:00
Nick:
This commit is contained in:
parent
d0c8d3ecde
commit
949791049f
|
@ -47,13 +47,18 @@ export async function scrapWithFireEngine({
|
|||
const reqParams = await generateRequestParams(url);
|
||||
const waitParam = reqParams["params"]?.wait ?? waitFor;
|
||||
const screenshotParam = reqParams["params"]?.screenshot ?? screenshot;
|
||||
const fireEngineOptionsParam = reqParams["params"]?.fireEngineOptions ?? fireEngineOptions;
|
||||
const fireEngineOptionsParam : FireEngineOptions = reqParams["params"]?.fireEngineOptions ?? fireEngineOptions;
|
||||
|
||||
let endpoint = fireEngineOptionsParam.method === "get" ? "/request" : "/scrape";
|
||||
|
||||
console.log(
|
||||
`[Fire-Engine] Scraping ${url} with wait: ${waitParam} and screenshot: ${screenshotParam}`
|
||||
`[Fire-Engine] Scraping ${url} with wait: ${waitParam} and screenshot: ${screenshotParam} and method: ${fireEngineOptionsParam?.method ?? "null"}`
|
||||
);
|
||||
|
||||
console.log(fireEngineOptionsParam)
|
||||
|
||||
const response = await axios.post(
|
||||
process.env.FIRE_ENGINE_BETA_URL + "/scrape",
|
||||
process.env.FIRE_ENGINE_BETA_URL + endpoint,
|
||||
{
|
||||
url: url,
|
||||
wait: waitParam,
|
||||
|
@ -74,6 +79,7 @@ export async function scrapWithFireEngine({
|
|||
console.error(
|
||||
`[Fire-Engine] Error fetching url: ${url} with status: ${response.status}`
|
||||
);
|
||||
|
||||
logParams.error_message = response.data?.pageError;
|
||||
logParams.response_code = response.data?.pageStatusCode;
|
||||
|
||||
|
|
|
@ -192,4 +192,14 @@ export const urlSpecificParams = {
|
|||
"ir.veeva.com":{
|
||||
defaultScraper: "fire-engine",
|
||||
},
|
||||
"eonhealth.com":{
|
||||
defaultScraper: "fire-engine",
|
||||
params:{
|
||||
fireEngineOptions:{
|
||||
mobileProxy: true,
|
||||
method: "get",
|
||||
engine: "request",
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue
Block a user