使用 WatiN 库验证码

发布于 2024-10-07 11:21:45 字数 173 浏览 0 评论 0原文

有人有“WatiN”库上验证码的经验吗?

我想要获取数据的网站在登录页面上有一个“验证码”。如果应用程序可以显示验证码图像并等待我在应用程序上给定文本框中的输入,我可以输入该值。

如果您想要一个样本,我们可以从这个库中实现这一点吗?

Does anyone have experiance with Captcha on "WatiN" library ?

The site I want to get data is having a "captcha" on the login page. I can enter that value if app can show captcha image and wait for my input in a given text box on app.

Can we achive that from this library, if you can like to have a sample.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

执手闯天涯 2024-10-14 11:21:45

好吧...看来您只想手动输入验证码值..!!!您想要自动化的其他字段。好吧,下面的解决方案可能并不完美,但它有效,它只是一个想法...或者您可以询问用户在输入框中输入验证码值(代替消息框使用),然后将该值放入验证码字段中。

        IE ie=new IE();

        ie.GoTo("http://captchas.net/registration/");
        ie.TextField(Find.ByName("user")).Value="username";
        ie.TextField(Find.ByName("mail")).Value="[email protected]";
        //string captch_value="";

        do
        {
            MessageBox.Show("Enter Captcha value...after entering correct captcha press Ok");

           //captch_value=ie.Eval("window.prompt('enter captcha')");
        }while(ie.ContainsText("Wrong Password entered. Try again"));

        //ie.TextField(Find.ByName("password")).Value=captch_value;

        ie.Button(Find.ByValue("Submit")).Click();

ok...It seems you want to enter only captcha value manually..!!!other fields you want to automate.Ok the below solution may not be perfect but it works and its just an idea...or you can ask user to input the captcha value in an input box(use in place of msgbox),then take the value and put it in the captcha field.

        IE ie=new IE();

        ie.GoTo("http://captchas.net/registration/");
        ie.TextField(Find.ByName("user")).Value="username";
        ie.TextField(Find.ByName("mail")).Value="[email protected]";
        //string captch_value="";

        do
        {
            MessageBox.Show("Enter Captcha value...after entering correct captcha press Ok");

           //captch_value=ie.Eval("window.prompt('enter captcha')");
        }while(ie.ContainsText("Wrong Password entered. Try again"));

        //ie.TextField(Find.ByName("password")).Value=captch_value;

        ie.Button(Find.ByValue("Submit")).Click();
笑,眼淚并存 2024-10-14 11:21:45

您可以将 Watin 与具有 API 的验证码解决服务集成,例如 http://www.deathbycaptcha.com 或类似的网站。所以你会执行以下操作。

  1. 在 Watin 中加载页面
  2. 获取验证码图像
  3. 将其提交到验证码求解器 API,他们将为您提供结果
  4. 获取该结果并将其放入验证码文本框中。

You can integrate Watin with a captcha solving service that has an API such as http://www.deathbycaptcha.com or similar site. So you would do the following.

  1. Load the Page in Watin
  2. Get the Captcha image
  3. Submit it to the Captcha Solver API they will provide you with the results
  4. Take that result and put it in the Captcha textbox.
东北女汉子 2024-10-14 11:21:45

据我所知,我们无法自动化所有的验证码。“完全自动化的公共图灵测试来区分计算机和人类”,顾名思义,它是用来防止自动化的。如果我们可以自动化验证码有什么用?只是很差设计的验证码可以使用复杂的匹配算法来捕获。

As far as I know we can't automate all CAPTCHA's."Completely Automated Public Turing test to tell Computers and Humans Apart",As the name implies it is used to prevent automation.If we can automate whats the use of CAPTCHA?Only Poorly designed CAPTCHA's can be captured using complex matching algorithms.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文