I am trying to select the "CAS Number" option on this website. From reading other posts, I have written several Python code using Selenium
driver.find_element_by_css_selector("select#selectbox > option[value='cas']").click()
driver.find_element_by_xpath("//select[@id ='selectbox']/option[@value ='cas']").click()
box = driver.find_element_by_id('selectbox')
for option in box.find_elements_by_tag_name('option'):
if option.text == 'cas':
option.select()
But they all fail to select the appropriate box. So I am wondering where the problem is.