Closed leoplct closed 4 years ago
I have to use setRequestInterception() to block images/font/images and to proxy each new page. I tried to UseProxy() at request-level but it's too slow. How can I fix it?
await page.setRequestInterception(true); page.on('request', (req) => { if( req.url().includes("images") || req.resourceType() == 'stylesheet' || req.resourceType() == 'font' || req.resourceType() == 'image' ){ req.abort(); }else { useProxy(req, `http://${ proxy_username }:${proxy_password}@host:port`); //<-- this is too slow //req.continue(); } });
Try v1.2.4
I have to use setRequestInterception() to block images/font/images and to proxy each new page. I tried to UseProxy() at request-level but it's too slow. How can I fix it?