<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
</head>

<body>

<p>测试单选</p>
<div>
<input type="radio" name="gender" value="male"> 男<br>
<input type="radio" name="gender" value="female"> 女<br>
<input type="radio" name="gender" value="other" checked="checked"> 其他
</div>

</body>
</html>
##########################################################################################3
# coding=utf-8
from selenium import webdriver
from selenium.webdriver.common.by import By

executable_path = r"C:\Program Files (x86)\Google\Chrome\Application\webdrivers\chromedriver.exe"
driver = webdriver.Chrome(executable_path)
driver.get('file:///E:/package/code/selenium/code/lesson04/rb.html')

# 这里使用了根据属性值来查找
input1 = driver.find_element_by_css_selector("input[value=male]")
input1.click()

input('press any key to quit...')
driver.quit() # 浏览器退出