我想从预订网站上的日历中选择返回日期。它选择了第一个“发件人:”日期,但无法选择我还尝试使用包装xpath的返回日期。
public static void main(String[] args) throws InterruptedException
{
System.setProperty("webdriver.gecko.driver","C:\\geckodriver-v0.17.0-win64\\geckodriver.exe");
WebDriver driver = new FirefoxDriver();
driver.get("https://www.makemytrip.com/");
Thread.sleep(3000L);
driver.findElement(By.xpath(".//*[@id='hp-widget__sfrom']")).click();
driver.findElement(By.xpath(".//*[@id='hp-widget__sfrom']")).sendKeys("GOI");
driver.findElement(By.xpath(".//*[@id='hp-widget__sfrom']")).sendKeys(Keys.TAB);
Thread.sleep(3000L);
driver.findElement(By.xpath(".//*[@id='hp-widget__sTo']")).sendKeys("AMD");
driver.findElement(By.xpath(".//*[@id='hp-widget__sTo']")).sendKeys(Keys.TAB);
driver.findElement(By.xpath(".//*[@id='hp-widget__depart']")).click();
driver.findElement(By.xpath(".//*[@data-month='0'][5]//a[text()='26']")).click();
Thread.sleep(3000L);
driver.findElement(By.xpath(".//*[@id='hp-widget__return']")).click();
driver.findElement(By.xpath("(.//*[@data-month='0']//a[text()='29'])[2]")).click();
}
}
我也想选择REtun日期
线程“main”中的异常org.openqa.selenium.ElementNotInteractableException: