Search code examples
pythonseleniumcaptcha2captcha

Python Selenium 2captcha bypass funcaptcha


I would like to bypass the funcaptchas on the Outlook login page. At the moment it is solved and I get the code, but I don't know how to change the HTML with Python to get further.

Hope you know what I mean and can help me. Thanks :)

Thats the Output:

result: {'captchaId': '72351812278', 'code': '81263a01d67793f12.2257185204|r=ap-southeast-1|metabgclr=%23ffffff|maintxtclr=%231B1B1B|mainbgclr=%23ffffff|guitextcolor=%23747474|metaiconclr=%23757575|meta_height=325|meta=7|pk=B7D8911C-5CC8-A9A3-35B0-554ACEE604DA|at=40|ag=101|cdn_url=https%3A%2F%2Fclient-api.arkoselabs.com%2Fcdn%2Ffc|lurl=https%3A%2F%2Faudio-ap-southeast-1.arkoselabs.com|surl=https%3A%2F%2Fclient-api.arkoselabs.com|smurl=https%3A%2F%2Fclient-api.arkoselabs.com%2Fcdn%2Ffc%2Fassets%2Fstyle-manager'}
def solveCaptcha():
    time.sleep(10)

    sys.path.append(os.path.dirname(os.path.dirname(os.path.realpath(__file__))))

    api_key = f'{API_KEY}'

    solver = TwoCaptcha(api_key)

    try:
        result = solver.funcaptcha(sitekey=f'{SITE_KEY}',
        url=f'{outlookurl}',
        surl='https://client-api.arkoselabs.com')

    except Exception as e:
        sys.exit(e)

    else:
        sys.exit('result: ' + str(result)

Like i said i want to bypass the funcatpchas for the outlook signup page.


Solution

  • Try to use Javascript getElementByID("id").value="the new value". You can use if you want selenium and use execute_script("js code") to keep programming in python and use the others selenium's functions.

    Link to execute_script: https://pythonbasics.org/selenium-execute-javascript/

    You have to find the element's id what you should change, the API said is the element with id: fc-token, but maybe it could be another attribute with that value. In Linkedin's Funcaptcha, there's no id with that value but as its name.

    Link to API's 2captcha FunCaptcha part: https://2captcha.com/2captcha-api#solving_funcaptcha_new