selenium API 随记
来源:互联网 发布:美得惊为天人知乎 编辑:程序博客网 时间:2024/06/04 20:15
webdriver
查找元素
- find_element_by_id
- find_element_by_xpath
- find_element_by_link_text
- find_element_by_partial_link_text
- find_element_by_name
- find_element_by_tag_name
- find_element_by_class_name
- find_element_by_css_selector
所有的以上操作,都有查找多个元素的对应操作find_elements_by_[option]
获取内容
窗口操作
执行js脚本
- script: The JavaScript to execute.
- *args: Any applicable arguments for your JavaScript. execute_async_script(script, *args) Asynchronously Executes JavaScript in the current window/frame.
cookie相关
- cookie_dict: A dictionary object, with required keys - “name” and “value”;
optional keys - “path”, “domain”, “secure”, “expiry”
超时设置
webelement
tagName
property. text The text of the element. click Clicks the element. submit Submits a form. clear Clears the text if it’s a text entry element. get_attribute(name) Gets the given attribute or property of the element. name - Name of the attribute/property to retrieve. If there’s no attribute with that name, None
is returned. is_selected Returns whether the element is selected. Can be used to check if a checkbox or radio button is selected. is_enabled Returns whether the element is enabled. find_element_by_[option] Finds element within this element’s children by option send_keys(value) Simulates typing into the element. - value - A string for typing, or setting form fields. For setting file inputs, this could be a local file path. size The size of the element. value_of_css_property The value of a CSS property. location The location of the element in the renderable canvas. rect A dictionary with the size and location of the element. screenshot_as_base64 Gets the screenshot of the current element as a base64 encoded string. screenshot_as_png Gets the screenshot of the current element as a binary data. screenshot Gets the screenshot of the current element. Returns False if there is any IOError, else returns True. Use full paths in your filename. parent Internal reference to the WebDriver instance this element was found from. 0 0
- selenium API 随记
- Selenium api
- Selenium API
- Selenium API
- Selenium API
- Selenium api
- selenium api
- daratable Api,随记
- iScroll5 API速查随记
- Selenium 中文API
- Selenium API说明文档
- Selenium 中文API
- Selenium 中文API
- Selenium 中文API
- Selenium 中文API
- selenium 中文API
- Selenium 中文API
- Selenium 中文API
- CDH5上安装Hive,HBase,Impala,Spark等服务
- Map四种遍历方法
- 站点授权程序截图
- StringBuffer的常用方法
- 浅谈电感的作用
- selenium API 随记
- Linux C++ 时间与日期
- mongodb 安装时出错 the defualt storage engine "wiredTiger" is not available 问题解决
- Chrome开启Notification通知等权限
- AS技巧合集「常用技巧篇」:
- 欢迎使用CSDN-markdown编辑器
- js操作cookie有效期至当天晚上23点59分59秒的cookie
- 【分享】WeX5的正确打开方式(5)——绑定机制
- centos7 elasticsearch 安装kaka-river 报错 "java.security.InvalidAlgorithmParameterException"