async function run() {
const browser = await puppeteer.launch({
args: ['--proxy-server=185.209.177.12:8080'],
headless: false,
});
I want node.js to reload browser and try again if proxy is down. The script gets stop executing when proxy is down I want it to continue executing**.
Could you do something like this?
async function run() {
while (true) {
try {
browser = await puppeteer.launch({
headless: true,
args: ["--proxy-server=185.209.177.12:8080"],
});
break;
} catch (e) {
console.log("Proxy temporarily unavailable, retrying...");
await sleep(5000);
}
}
}