C# cannot solve captcha

30 Views Asked by At

So i have this code:

            using (IWebDriver driver = new ChromeDriver())
            {
                driver.Navigate().GoToUrl("https://unmatched.gg/register");

                IWebElement allowCookiesButton = driver.FindElement(By.XPath("//button[contains(., 'Allow cookies')]"));
                allowCookiesButton.Click();

                string captchaCode = SolverClass.Main();
                if (captchaCode != null)
                {
                    Console.WriteLine("Captcha code: " + captchaCode);
                    IWebElement captchaResponseElement = driver.FindElement(By.CssSelector("input[name='captcha-response']"));
                    captchaResponseElement.SendKeys(captchaCode);
                }
                else
                {
                    Console.WriteLine("Failed to solve captcha.");
                }
            }

But it dosnt matter what i put for captcha0resonse code because it wont find it, even if i add wait or sleep/delay. And even if it finds it, im not sure how to verify it, the capcha solver works, im using 2captcha as a nuget package, yes i have it payed, and it gives me back the solved captcha code.

I tried every thing, from changing the tags to types, and it still dosnt work. Here for example i left it without h- or other stuff because i alredy tried it with g- and h- something like this: input[name='captcha-response if is anyone able to help me, i woud be more then happy to read your respunse.

0

There are 0 best solutions below