Skip to content
Advertisement

Finding button by XPath with Selenium

I have been trying to locate the following button using Selenium WebDriver:

JavaScript

I used css selector, xpath, class and nothing seems to work (even by just copy pasting the one given by the inspector. The closest I’ve been is locating the div with the class _1ibtygfe) Here is everything I tried, I’m desperate I don’t understand why it does not locate it, it keeps throwing me a No Such Element exception.

JavaScript

It’s the airbnb website, I’m trying to scrape their events and clicking on the see more button. Thanks for your help.

Advertisement

Answer

If you want to click this button you need to

  1. Close the “Accept cookies”
  2. Scroll to that button since in is out of the visible screen area.
  3. Click on it
    As following:
JavaScript
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement