Selecting elements via CSS attribute selectors in Selenium

See here for the original answer.

Xpath can be a hassle sometimes, I recommend using the CSS selector method to accomplish this:

element = driver.find_elements_by_css_selector("[aria-label='1100-1200-200167-620038']")

You could them use the element in your visibility_of_element_located method.


Tags

  1. python (Private)
  2. selenium (Private)
  3. css (Private)
  4. stack-overflow (Private)
  5. answer (Private)