Python/selenium

selenium) 라디오버튼 값 얻기 .get_attribute

유노파이 2022. 1. 17. 10:37

 

# 1번 라디오버튼이 클릭 되어있는지 true or false
radio_value = driver.find_element_by_xpath('xpath').get_attribute("checked")

>>> print (radio_value) 
>>> true


# value 값 얻기
radio_value = driver.find_element_by_xpath('xpath').get_attribute("value")

>>> print (radio_value) 
>>> 1번버튼