gpt4 book ai didi

java - 如何使用 java 使用 WebDriver 创建新的 google 帐户期间读取图像框中的文本

转载 作者:行者123 更新时间:2023-12-02 07:01:58 24 4
gpt4 key购买 nike

如何在 Java 中使用 WebDriver 创建新的 Google 帐户时读取图像框中的文本。我正在使用 Java 中的 WebDriver 创建一个新的 Gmail 帐户。我无法阅读图像框中存在的文本。有人可以帮我解决这个问题吗?

我使用的代码是:

driver = new InternetExplorerDriver();
driver.get("http://gmail.com");
Thread.sleep(10000);
driver.findElement(By.id("link-signup")).click();
Thread.sleep(10000);
driver.findElement(By.id("FirstName")).sendKeys("Swamy");
driver.findElement(By.id("LastName")).sendKeys("Kumar");
driver.findElement(By.id("GmailAddress")).sendKeys("Skumar081112");
driver.findElement(By.id("Passwd")).sendKeys("Swamy@123");
driver.findElement(By.id("PasswdAgain")).sendKeys("Swamy@123");
driver.findElement(By.xpath("//label[@id='month-label']/span/div
/div")).sendKeys("November");
driver.findElement(By.id("BirthDay")).sendKeys("16");
driver.findElement(By.id("BirthYear")).sendKeys("1978");
driver.findElement(By.xpath("//div[@id='Gender']/div/div")).sendKeys("Male");
driver.findElement(By.id("RecoveryPhoneNumber")).sendKeys("9000000000");
driver.findElement(By.id("RecoveryEmailAddress")).sendKeys("abc@gmail.com");
driver.findElement(By.id("HomepageSet")).click();
String imgmsg = driver.findElements(By.xpath("//div[@id='recaptcha_image']
/img")).toString();
System.out.println(imgmsg);

我们将不胜感激...

最佳答案

你不能

该文本称为 CAPTCHA它旨在阻止自动化系统创建帐户(并且显然做得相当不错)。

A CAPTCHA (pron.: /ˈkæp.tʃə/) is a type of challenge-response test used in computing as an attempt to ensure that the response is generated by a human being. The process usually involves a computer asking a user to complete a simple test which the computer is able to grade. These tests are designed to be easy for a computer to generate but difficult for a computer to solve, but again easy for a human. If a correct solution is received, it can be presumed to have been entered by a human. A common type of CAPTCHA requires the user to type letters and/or digits from a distorted image that appears on the screen. Such tests are commonly used to prevent unwanted internet bots from accessing websites, since a normal human can easily read a CAPTCHA, while the bot cannot process the image letters and therefore, cannot answer properly, or at all. Although most CAPTCHAs are letter pictures randomly generated, many of them have become difficult even for a human to read , so picture CAPTCHAs were created in which a human is shown a simple test to show a picture of a certain animal (given few animal pictures), which is simple for a human being to process, and therefore easy to pick, while a bot cannot process and solve the question because although it can analyze the picture, it cannot easily guess the animal. The term "CAPTCHA" was coined in 2000 by Luis von Ahn, Manuel Blum, Nicholas J. Hopper, and John Langford (all of Carnegie Mellon University). It is an acronym based on the word "capture" and standing for "Completely Automated Public Turing test to tell Computers and Humans Apart". Carnegie Mellon University attempted to trademark the term on 15 October 2004,1 but the trademark application was abandoned on 21 April 2008.[2] A CAPTCHA is sometimes described as a reverse Turing test, because it is administered by a machine and targeted at a human, in contrast to the standard Turing test that is typically administered by a human and targeted at a machine.

关于java - 如何使用 java 使用 WebDriver 创建新的 google 帐户期间读取图像框中的文本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16539410/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com