単純なボットを作ろうとしましたが、このエラーが発生しました。Javaエラー:適用できませんでした。java.lang.String
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
public class Main {
public static void main(String[] args) throws InterruptedException {
WebDriver driver = new ChromeDriver();
driver.get("https://***.com/#/");
driver.findElement(By.xpath("//*[@id=\"homepage-hero\"]/a/img")).click(); // clicks site steam sign in button
WebElement steamUsername = driver.findElement(By.xpath("//*[@id=\"steamAccountName\"]"));
WebElement steamPassword = driver.findElement(By.xpath("//*[@id=\"steamPassword\"]"));
steamUsername.sendKeys("***");
steamPassword.sendKeys("***");
Thread.sleep(45000);
WebElement updatedBalance = driver.findElement(By.xpath("//*[@id=\"header-balance\"]"));
WebElement balance = driver.findElement(By.xpath("//*[@id=\"header-balance\"]"));
if(updatedBalance.getText() > balance.getText()); {
System.out.println("hello");
}
}
}
error: could not be applied too java.lang.String
投稿を編集し、COMPLETEエラーメッセージをコピー/貼り付けする必要があります。また、エラーが発生したコード内の行を識別します。 [help]にアクセスして[ask] –