feat: some stuff
This commit is contained in:
parent
ffa134a879
commit
5fac6de05a
@ -25,6 +25,7 @@ export async function fetchHtmlWithPlaywright(
|
|||||||
username: env.PROXY_USERNAME,
|
username: env.PROXY_USERNAME,
|
||||||
password: env.PROXY_PASSWORD,
|
password: env.PROXY_PASSWORD,
|
||||||
};
|
};
|
||||||
|
console.log("Using proxy server", config);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Launch the Playwright browser
|
// Launch the Playwright browser
|
||||||
@ -34,15 +35,7 @@ export async function fetchHtmlWithPlaywright(
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
// Open a new browser context and page
|
// Open a new browser context and page
|
||||||
const context = await browser.newContext({
|
const context = await browser.newContext();
|
||||||
userAgent:
|
|
||||||
userAgentStrings[Math.floor(Math.random() * userAgentStrings.length)],
|
|
||||||
});
|
|
||||||
|
|
||||||
//add init script
|
|
||||||
await context.addInitScript(
|
|
||||||
"Object.defineProperty(navigator, 'webdriver', {get: () => undefined})",
|
|
||||||
);
|
|
||||||
|
|
||||||
const page = await context.newPage();
|
const page = await context.newPage();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user