How to use puppeteer to access a site that is protected with CloudFlare? It's not that it blocks my connection or even shows a captcha. The principle of operation is as follows: I enter the site address, I get to the CloudFlare page, after a couple of seconds it redirects me to the site itself. When using puppeteer redirects do not occur. However, if you use "headless":false
and carefully monitor the Chromium address bar, you can notice that for a split second it changes, but ultimately no redirect occurs.
const puppeteer = require('puppeteer');
(async () => {
const browser = await puppeteer.launch({"headless":false});
const page = await browser.newPage();
await page.goto('https://www.orrick.com/');
await page.waitForSelector(".homepage");
await page.screenshot({path: 'example.png'});
await browser.close();
})();
Video (speed 0.1): https://gfycat.com/circularfearlessgemsbuck
P. S. The application for which I am trying to use puppeteer is written in PHP. I am ready to consider any analogues of puppeteer that provide similar functionality (web browser emulation) and are actual as of 2022.