Reputation: 11
I am trying to press the + icon present under Bedrooms. I even hard-coded a 5 seconds wait. The last line throws element not found exception. Please, help me.
driver.get("https://www.tripadvisor.in/VRACSearch-g294207-Reviews-Nairobi-Vacation_Rentals.html");
driver.findElement(By.xpath("//div[@class='_2uJXqhFj']")).click();
Thread.sleep(5000);
driver.findElement(By.xpath("//body/div[14]/div[1]/div[1]/div[2]/div[1]/div[2]/div[1]/div[2]/span[2]/span[1]")).click();
Upvotes: 1
Views: 48
Reputation: 1441
Try this:
.//div[text()='Bedrooms']//following-sibling::div/span/span[contains(@class,'ui_icon plus')]
Upvotes: 1
Reputation: 4212
Try using css selector for this icon:
._1laeAPbS:nth-of-type(1) .plus
Upvotes: 0