puppeteer-dart
puppeteer-dart copied to clipboard
infinite 503 problem cloudflare page
hi i always stuck on this cloudflare page https://anime-flix.net/
import '../bin/utils/string.dart';
import 'package:puppeteer/plugins/stealth.dart';
import 'package:puppeteer/puppeteer.dart';
Future<void> main() async {
puppeteer.plugins.add(StealthPlugin());
var browser = await puppeteer.launch(headless: false, args: [
],noSandboxFlag: true, ignoreHttpsErrors: true,ignoreDefaultArgs: true
);
var page = ( await browser.pages).first;
await page.setJavaScriptEnabled(true);
await page.goto("https://anime-flix.net/");
}
@linkkader have you found a solution? @xvrh any advice on how to solve this? I am stuck on a Cloudflare page as well.
My scenario is a bit different though, I need to solve a challenge like this:
but even if I solve it manually, I am stuck in an infinite redirection loop.
Cloudflare seems to detect the chromium instance because I am running puppeteer locally so the IP should be safe, right?
I have tried to launch puppeteer with the StealthPlugin
and add a few extra steps, but no success:
await page.setJavaScriptEnabled(true);
await page.setUserAgent(
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36',
);
await page.setExtraHTTPHeaders({
'Accept-Language': 'en-US,en;q=0.9',
});
@Wizzel1 yes there is a ploblem with StealthPlugin() in my case i solve it by directly modify it i compare it with javascript StealthPlugin
@linkkader thats great, would you mind sharing your modifications?
@Wizzel1 @linkkader any update ?
@Zhairgling Unfortunately not
@Wizzel1 @Zhairgling you can check here the modification i add https://github.com/linkkader/puppeteer-dart let me know if it works
@Wizzel1 @Zhairgling you can check here the modification i add https://github.com/linkkader/puppeteer-dart let me know if it works
working for me. Thanks
@linkkader Sorry for my late answer. Your PR did not work for me, unfortunately.
I had to set the pages userAgent to make it work in my case.
page = await browser.newPage();
await page.setUserAgent(
'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/110.0',
);