Start a new topic

ERR_UNEXPECTED_PROXY_AUTH using crawlera with puppeteer

I know this is similar to  https://support.scrapinghub.com/support/discussions/topics/22000010422

but I am using my API key.  I'm not sure if I am using it in the right section, I am just following some of the documentation I have seen for puppeteer.  Below are the relevant sections of my code.



 

browser = await puppeteer.launch({

     args: [/*'--disable-dev-shm-usage', */

              `--proxy-server=proxy.crawlera.com:8010`,'--ignore-certificaterrors                              https://httpbin.org/get'

      ],

ignoreHTTPSErrors: true

});


 

proxy_auth = "<MyAPIKey>:";

 await page.setExtraHTTPHeaders({

 

                 'Proxy-Authorization':      'Basic ' + Buffer.from ('<MYAPIKEY>:').toString('base64'),

 

 

});


Thanks in advance


1 person has this question
1 Comment

Hi,


The is kinda messy, but seem right.

I'm attaching a working example using puppeteer@1.17.0


Hope this helps.

js
(1.38 KB)
Login to post a comment