changed browser open page logic #2

Merged
saif.haq merged 1 commits from psw-crawler into main 2026-01-23 06:26:18 +00:00
1 changed files with 20 additions and 6 deletions

View File

@ -22,12 +22,26 @@ const utils = require("./utils");
const environment = process.env["ENVIRONMENT"]; const environment = process.env["ENVIRONMENT"];
const browser = await puppeteer.launch({ // launch browser and open page
headless: "new", const chromeProfilePath = path.resolve(
args: ["--no-sandbox", "--disable-setuid-sandbox"] __dirname,
}); config[environment]["chrome_profile_path"]
);
const page = await browser.newPage(); const browser = await puppeteer.launch(
utils.getBrowserConfig(chromeProfilePath, environment)
);
const page = await browser.newPage();
await page.setViewport({
width: 1600,
height: 900,
});
// Inject CSS to show the cursor
await page.evaluate(() => {
const style = document.createElement("style");
style.innerHTML = "* { cursor: auto !important; }";
document.head.appendChild(style);
});
await page.goto( await page.goto(
config[environment].psw_url, config[environment].psw_url,