Skip to content
CodeKruPro

Using Select on a dropdown built from divs (Python)

QuizMediumPython onlyAsked in: Accenture, Infosys, TCS

The country dropdown is built from <div> and <li> elements. What does Select(driver.find_element(By.ID, "country")) do?

  • It raises UnexpectedTagNameException, because Select works only on select elements
  • It works the same as on a select element
  • It returns a Select with an empty options list
  • It raises NoSuchElementException

This question is part of Pro+

Pro+ opens every question in Interview Prep and the mock interview. Every article and the first 2 questions of each topic stay free. Hands-on Selenium and API tasks follow their course lesson's own lock.

See Pro+

Already have Pro+? Sign in