2captcha / 2captcha-csharp

C# library for easy integration with the API of 2captcha captcha solving service to bypass recaptcha, hcaptcha, funcaptcha, geetest and solve any other captchas.
http://2captcha.com
82 stars 26 forks source link

recapcha v2 not work in real website #29

Open tuannh6495 opened 4 weeks ago

tuannh6495 commented 4 weeks ago

Please help me resolve it! I tested recaptcha v2 in https://google.com/recaptcha/api2/demo and I worked. But when I try in this url: https://bds68.com.vn/dang-ky. I got the code from 2captcha then I put it into textarea tag with id="g-recaptcha-response", it's not worked! there is my code: var captchaEle = await page.QuerySelectorAsync("div[id=\"recaptcha\"]"); if (captchaEle != null) { var siteKey = await captchaEle.GetAttributeAsync("data-sitekey"); if (siteKey != null) { string capCode = ""; TwoCaptcha.TwoCaptcha solver = new TwoCaptcha.TwoCaptcha(ApiKey);

    ReCaptcha captcha = new ReCaptcha();
    captcha.SetSiteKey(siteKey);
    captcha.SetUrl(urlPage);
    solver.Solve(captcha).Wait();
    capCode = captcha.Code;

    await page.EvalOnSelectorAsync("#g-recaptcha-response", @"(element) => { 
        element.style.display = 'block'; 
    }");
    await page.EvalOnSelectorAsync("#g-recaptcha-response", $"(element, value) => element.value = value", capCode);
    await page.ClickAsync("input[type=\"submit\"]");
}

} Thanks a lot!

tuannh6495 commented 4 weeks ago

It worked in this site: https://mogi.vn/ which is a reCAPTCHA V2 Invisible (have not I'm not robot)