so I'm trying to use the puppeteer-page-proxy module (https://www.npmjs.com/package/puppeteer-page-proxy) to apply a proxy to my scraping. The documentation looks good, but for some reason my code isn't running past my useProxy() function, and I'm not sure why, because there is no error logged to the console:
const puppeteer = require('puppeteer');
const puppeteerExtra = require('puppeteer-extra');
const pluginStealth = require('puppeteer-extra-plugin-stealth');
const useProxy = require('puppeteer-page-proxy');
puppeteerExtra.use(pluginStealth());
const browser = await puppeteerExtra.launch({ headless: true, args: [
'--no-sandbox',
'--disable-setuid-sandbox',
]});
const page = await browser.newPage();
await useProxy(page, 'http://127.0.0.1:8000'); // this is the line of code that is causing problems
//If I move the below two lines above the useProxy() function, they print correctly, but where it current is placed, nothing happens.
const data = await useProxy.lookup(page);
console.log("Proxy here is: " + data.ip);
await page.goto(`www.stackoverflow.com`);
Essentially, I'm just trying to make it so every time this function is called, the proxy that the page is created with changes. I think I'm close but I followed the documentation exactly and I'm not sure what to do. Any help is much appreciated!