MontFerret / worker

Containerized Ferret worker
Apache License 2.0
14 stars 7 forks source link

How to avoid CloudFlare Capcha? #25

Open byteshiva opened 2 years ago

byteshiva commented 2 years ago

For example, I tried open a site behind Cloudflare, and it threw the below error. How can I avoid Cloudflare captcha errors? or How could I install privacypass chrome extension provided by Cloudflare

{
    "text": "RETURN DOCUMENT(@url, {driver: 'cdp'})",
    "params": {
        "url": "https://some.site.behind.cloudflare/"
      }
}
"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n \n\n\n\n\n
\n
Please enable cookies.
\n
\n
\n \n
One more step

\n \n \n
Another way to prevent getting this page in the future is to use Privacy Pass. You may need to download version 2.0 now from the [Chrome Web Store](https://github.com/%22https://chrome.google.com/webstore/detail/privacy-pass/ajhmfdgkijocedmfjonnpjfojldioehi/%22).

\n
\n\n\n
\n
\"\"\n\n \n\n\n\n\n"
ziflex commented 2 years ago

Try to use a different agent name.

For example:

{ driver: "cdp", userAgent: "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome 76.0.3809.87 Safari/537.36"}
ziflex commented 2 years ago

Also, you may try to not use headless mode in Chrome. But at this moment, you will need to implement it yourself because the official Ferret Chromium Docker image does not support it.