Skip to content
Advertisement

How to interact with the button using Selenium webdriver and Python

I want to try filling out the form on this page: https://konzinfoidopont.mfa.gov.hu. However, when I try to select the dropdown menu and click it, I get the following error:

JavaScript

This is the mentioned button:

JavaScript

And my code yet:

JavaScript

Advertisement

Answer

The desired element is within a Modal Dialog Box, so to click on the clickable element you need to induce WebDriverWait for the element_to_be_clickable() and you can use either of the following locator strategies:

  • Using CSS_SELECTOR:

    JavaScript
  • Using XPATH:

    JavaScript
  • Note: You have to add the following imports :

    JavaScript
  • Browser snapshot:

konzinfoidopont

Advertisement