How to get the value of an element in Python + Selenium?

前端 未结 2 592
感动是毒
感动是毒 2021-02-15 12:16

I have got this HTML element in my Python (3.6.3) code (as Selenium webelement of course):



        
2条回答
  •  情书的邮戳
    2021-02-15 12:37

    Try the following code:

    span_element = driver.find_element_by_css_selector(".ocenaCzastkowa.masterTooltip")
    span_element.text # This will return "5".
    

    PS: Also you can use span_element.get_attribute("value").

    Hope it helps you!

提交回复
热议问题