ERR_UNEXPECTED_PROXY_AUTH using crawlera with puppeteer

Posted over 5 years ago by varunsub

Post a topic
Un Answered
v
varunsub

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 Votes


1 Comments

peixoto

peixoto posted over 5 years ago Admin

Hi,


The is kinda messy, but seem right.

I'm attaching a working example using [email protected]


Hope this helps.

Attachments (1)

0 Votes

Login to post a comment