feat: some stuff
This commit is contained in:
parent
ffa134a879
commit
5fac6de05a
@ -25,6 +25,7 @@ export async function fetchHtmlWithPlaywright(
|
||||
username: env.PROXY_USERNAME,
|
||||
password: env.PROXY_PASSWORD,
|
||||
};
|
||||
console.log("Using proxy server", config);
|
||||
}
|
||||
|
||||
// Launch the Playwright browser
|
||||
@ -34,15 +35,7 @@ export async function fetchHtmlWithPlaywright(
|
||||
|
||||
try {
|
||||
// Open a new browser context and page
|
||||
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 context = await browser.newContext();
|
||||
|
||||
const page = await context.newPage();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user