Unable to click invisible select python
<p>I am trying to retrieve all possible lists from <a href="https://www.osram-americas.com/en-us/applications/automotive-lighting-systems/Pages/lrgmain.aspx" rel="nofollow">this website</a></p>

<p>Model will only open when year is selected. Similarly Make will only open when Model is selected. I want to store all combination of Year, Model and Make for learning purpose.</p>

<p>However I am not able to click year field only. It seems it is hidden and without this I can't go ahead with rest of code.</p>

<pre><code>from selenium import webdriver
import time
from selenium.webdriver.support.ui import Select
from bs4 import BeautifulSoup

driver = webdriver.Chrome()
driver.get("https://www.osram-americas.com/en-us/applications/automotive-lighting-systems/Pages/lrgmain.aspx")
# Switch to new window opened
driver.switch_to.window(driver.window_handles[-1])
# Close the new window
driver.close()
# Switch back to original browser (first window)
driver.switch_to.window(driver.window_handles[0])

el = driver.find_element_by_id('sbToggle_27562807')
el.click()
</code></pre>

<p>It gives error :-</p>

<blockquote>
  <p>Message: no such element: Unable to locate element: {"method":"id","selector":"sbToggle_27562807"}</p>
</blockquote>

<p>Use this CSS selector to get to the arrow pointing downwards on the select year dropdown</p>

<pre><code>"div[id='fldYear'] &gt; div[class='sbHolder'] &gt; a[class='sbToggle']"
</code></pre>

<p>or this xpath</p>

<pre><code>"//div[@id='fldYear']/div[@class='sbHolder']/a[@class='sbToggle']"
</code></pre>

<p>Click on this to webelement to get the options</p>

python selenium web-scraping