Hcaptcha + 2captcha/anticaptcha in Python Selenium Chromedriver
10 months ago, you needed
driver.execute_script(f"grecaptcha.getResponse = function(){return '{token}'}")
Now you need inject js code before all scripts on a page with injecting hcaptcha object with special attribute render for intercept a callback function. https://alexandrsokolov-41020.medium.com/%D1%80%D0%B5%D1%88%D0%B0%D0%B5%D0%BC-hcaptcha-9eebf2ee3c5a