-
Notifications
You must be signed in to change notification settings - Fork 28
Open
Description
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!
Metadata
Metadata
Assignees
Labels
No labels