1

I have difficulties selecting an option in select drop-down. I have tried everything, but nothing works for me. I am using most recent libraries of everything. Part of the code...

from selenium.webdriver.support.ui import Select

select = Select(driver.find_element(By.XPATH, '/html/body/div[3]/article/div[4]/div/div/form/div[4]/div[4]/div/div/select'))
options = select.options
num_options = len(options) - 1

select.select_by_index(num_options)

The num_options variable get value 2, as there are two available options in this select at the moment (but number of options can vary, so I have created a variable for it).

The problem is at the last step, where I receive the following error in python:

selenium.common.exceptions.ElementClickInterceptedException: Message: Element is not clickable at point (674.7333374023438,680.1499938964844) because another element obscures it

What can I do? This is the website: https://www.banka-koper.si/Tecajnica and this is the questionable drop-down:

enter image description here

gdolenc
  • 301
  • 1
  • 2
  • 17

1 Answers1

0

try scrolling to the element before clicking it.

option = options[num_options]

driver.execute_script("arguments[0].scrollIntoView();", option)

option.click

some more ideas here

Vladimir Efimov
  • 797
  • 5
  • 13