Selenium

选择元素

  • 通过class属性选择元素  
    • If there is a lot of class value,they can't be regard as an enirety and each word represent a depent value.
    •  
    • WebDriver can use to locate item and web element can also use to locate the item.
    •    
    • 点击元素获取元素中心点位置,通过得到的位置判断是否是能够用来操作页面,点击元素 通过.click()方法
    •  
    • 针对输入框的操作 .send_keys(‘’) ,.clear()
    • 获取页面中的文本内容 element.get_attribute('value')  ---show in the page     element.get_attribute('innerText') ---not show in the page

翻译 朗读 复制 正在查询,请稍候…… 重试 朗读 复制 复制 朗读 复制 via 谷歌翻译(国内)

posted @ 2020-08-16 00:08  KeyGun  阅读(153)  评论(0)    收藏  举报