-1
<span id="app_status_health">
 <span class="status_indicator yellow" id="ext-gen10267"></span>
</span>

I wanted to know if its possible to get the class name "status_indicator yellow" and store it in a variable.

Ratmir Asanov
  • 6,237
  • 5
  • 26
  • 40
K. Abhulimen
  • 137
  • 1
  • 13

1 Answers1

2

Try the following code:

class_name = driver.find_element_by_css_selector("#app_status_health>span").get_attribute("class")

Hope it helps you!

Ratmir Asanov
  • 6,237
  • 5
  • 26
  • 40