zoukankan      html  css  js  c++  java
  • css定位

    driver.find_elements_by_css_selector("#blog_nav_contact")#id
    driver.find_elements_by_css_selector(".menu")#class
    driver.find_elements_by_css_selector("a")#标签
    driver.find_elements_by_css_selector("[rel='nofollow']")#其他属性
    driver.find_elements_by_css_selector("type='text'")#type属性
    #标签与属性的组合
    driver.find_elements_by_css_selector("input:contains('kw')")
    driver.find_elements_by_css_selector("input.s_ipt")#标签和class属性
    driver.find_elements_by_css_selector("input#kw")#标签和id属性
    driver.find_elements_by_css_selector("input[id='kw']")#标签和其他属性
    driver.find_elements_by_css_selector("form#form>span>input")
    driver.find_elements_by_css_selector("form.fm>span>input")
    #<select id='na' name='me'>
    #<option selected="" value="北京">北京</option>
    #<option value="上海">上海</option>
    #<option value="天津">天津</option>
    #</select>
    driver.find_elements_by_css_selector("select#na>option:nth-child(1)")#选择北京
    driver.find_elements_by_css_selector("select#na>option:nth-child(2)")#选择上海
    driver.find_elements_by_css_selector("select#na>option:nth-child(3)")#选择天津
    #逻辑运算
    driver.find_elements_by_css_selector("input[id='kw'][name='wd']")
  • 相关阅读:
    简单工厂模式
    1.go的Hello
    Scrapy003-项目流程
    Django1.9开发博客(6)- 模板继承
    Django开发博客- 页面美化
    Django开发博客- 三部曲
    Django开发博客- 部署
    Django开发博客- 模型
    Django开发博客 入门篇
    内装式模块
  • 原文地址:https://www.cnblogs.com/hhm8hhm/p/7214812.html
Copyright © 2011-2022 走看看