I am trying to select an option from http://www.lacoteargus.ma/cote-maroc/recherche/
But I am getting this error:selenium.common.exceptions.ElementNotVisibleException: Message: element not interactable: Element is not currently visible and may not be manipulated
in this line Brands.select_by_visible_text('BMW')
Here is my script:
from selenium.webdriver.support.ui import Select
from selenium.webdriver.chrome.options import Options
import os
import time
Email = '***************'
Pass = '******'
LoginUrl = 'http://www.lacoteargus.ma/'
chrome_options = Options()
chromedriver_path = os.path.join(os.getcwd(), "chromedriver")
driver = webdriver.Chrome(executable_path=chromedriver_path, options=chrome_options)
driver.get(LoginUrl)
driver.find_element_by_name('strLogin').send_keys(Email)
driver.find_element_by_name('strPwd').send_keys(Pass)
driver.find_element_by_id('validation').click()
time.sleep(10)
driver.find_element_by_class_name('caret').click()
time.sleep(1)
Brands = Select(driver.find_element_by_id('marque'))
Brands.select_by_visible_text('BMW')
I have also tried:
Brands.select_by_value('1')
and Brands.select_by_index('1')
None of them are working.