title: Headless Puppeteer - Avoid being detected by Akamai
body: <p>Hi I'm trying to scrape a website that is powered by Akamai for bot protection. I'm unable to make it past a Login page due to Akamai blocking my login request.</p>
  <p>Firstly I would like to say that, Yes there are a lot of guides on how to avoid being detected by things like Akamai but those are now irrelevant as companies like Akamai are getting better and better through the use of their AI to detect new bots.</p>
  <p>So let me tell you the basics of what my script is running:</p>
  <ul>
  <li>Puppeteer (Headless Mode)</li>
  <li>puppeteer-extra-plugin-stealth</li>
  </ul>
  <p>For the Chrome Flags:</p>
  <pre><code>var chromeFlags = [
      '--no-sandbox',
      '--disable-setuid-sandbox',
      '--disable-accelerated-2d-canvas',
      '--no-zygote',
      '--renderer-process-limit=1',
      '--no-first-run',
      '--ignore-certificate-errors',
      '--ignore-certificate-errors-spki-list',
      '--disable-dev-shm-usage',
      '--disable-infobars',
      '--lang=en-US,en',
      '--window-size=1920x1080',
      '--disable-extensions'
    ];
  </code></pre>
  <p>I've also spoofed the Timezones and Viewport:</p>
  <pre><code>await page.emulateTimezone(&quot;Asia/Singapore&quot;);
  await page.setViewport({width: (width/2)-21, height: height-111});
  </code></pre>
  <p>Form what I heard, Akamai has specifically known to scrutinize window/screen sizes. I've done everything I think is necessary to ensure the headless mode mimics an actual browser but to no avail.</p>
  <p>Theres a website that shows you your browser fingerprints <a href="https://bot.sannysoft.com/" rel="nofollow noreferrer">bot.sannysoft.com</a> . I'm currently using that to compare if the headless puppeteer mimics an actual headful browser and so far It seems that it looks like a legitimate browser. Here's the result from that website I got with my headless puppeteer <a href="https://i.stack.imgur.com/hfuYZ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/hfuYZ.png" alt="enter image description here" /></a></p>
  <p>I hope someone is able to tell me if there's anything I should try spoofing next to maybe increase my chance of not being detected by Akamai or point out where I did wrong.</p>
  <p>Thanks everyone!</p>