Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incapsula #3

Open
stevenmirabito opened this issue May 22, 2019 · 1 comment
Open

Incapsula #3

stevenmirabito opened this issue May 22, 2019 · 1 comment

Comments

@stevenmirabito
Copy link
Owner

OneVanilla balance checks are protected by Incapsula, which will require additional measures to bypass.

More information: https://kb.apify.com/overcoming-anti-scraping-protection/several-tips-how-to-bypass-website-anti-scraping-protections

@j4jstyle
Copy link

Those options are doing the job

        user_agent = random.choice(user_agent_list)
        options.add_argument(f'user-agent={user_agent}')
        options.add_experimental_option("excludeSwitches", ["enable-automation"])
        options.add_experimental_option('useAutomationExtension', False)
        options.add_argument('--disable-blink-features=AutomationControlled')
        options.add_argument('--proxy-server=http://{}'.format(PROXY_HOST + ":" + PROXY_PORT))
        options.headless = False
        options.add_argument("--start-maximized")
        options.add_argument("--window-size=1920x1080")
        options.add_argument('--ignore-certificate-errors')
        options.add_argument('--allow-running-insecure-content')
        options.add_argument("--disable-extensions")
        options.add_argument('--disable-gpu')
        options.add_argument('--disable-dev-shm-usage')
        options.add_argument('--no-sandbox')
        browser = webdriver.Chrome(options=options)

You just need to execute the callback scripts with captcha token.

Sample for VanillaGift

        captcharesult = token
        browser.execute_script("arguments[0].style.display='inline'", browser.find_element_by_id("g-recaptcha-response"))
        browser.execute_script('document.getElementById("g-recaptcha-response").innerHTML = "%s"' % captcharesult)
        callbackpath = f'___grecaptcha_cfg.clients[0].Z.Z.callback("{captcharesult}")'
        callbackpath1 = f'___grecaptcha_cfg.clients[0].l.l.callback("{captcharesult}")'

There's two callbackpath in my sample, because it's keep changing on every request; so make the script test them, if it fail on the first one, it will try the second path; else it will pass.

Good luck

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants