zoukankan      html  css  js  c++  java
  • 单选框

    <!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)GoogleChromeApplicationwebdriverschromedriver.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() # 浏览器退出
  • 相关阅读:
    JDBC_查询
    微信web小程序开发1
    小型人口普查系统2
    小型人口普查系统1
    JSP内置对象作用域
    Session和Cookie的区别
    Cookie
    Session
    c++中嵌入python
    目标文件obj的各段 2
  • 原文地址:https://www.cnblogs.com/liyonglong888/p/11157639.html
Copyright © 2011-2022 走看看