Skip to content

Commit

Permalink
fix: pptr launch errors
Browse files Browse the repository at this point in the history
  • Loading branch information
pgagnidze committed Dec 12, 2023
1 parent 3b05344 commit 804d85d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
1 change: 1 addition & 0 deletions examples/sample.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import puppeteer from "puppeteer";
await owl({
headless: false,
puppeteer,
proxyString: "u:p@139.5.73.71:8080",
actions: [
{
action: "set-viewport",
Expand Down
15 changes: 13 additions & 2 deletions src/bird/owl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ export const owl = async ({
});
const [credential, proxyStr] = proxyString.split("@");
if (credential && proxyStr) {
console.log(`Proxy: ${proxyStr || credential}`);
chromiumArgs.push(`--proxy-server=${proxyStr || credential}`);
}
}
Expand Down Expand Up @@ -179,14 +180,24 @@ export const owl = async ({
throw new BirdError({
code: "PUPPETEER__ERROR_LAUNCHING_WITH_PROXY",
message: PUPPETEER__ERROR_LAUNCHING_WITH_PROXY,
data: e,
data: {
flyRecord,
screenshot: '',
html: '',
finalResults,
},
});
}
console.error(e);
throw new BirdError({
code: "PUPPETEER__ERROR_LAUNCHING_BROWSER",
message: PUPPETEER__ERROR_LAUNCHING_BROWSER,
data: e,
data: {
flyRecord,
screenshot: '',
html: '',
finalResults,
},
});
}

Expand Down

0 comments on commit 804d85d

Please sign in to comment.