# violent-webdriver **Repository Path**: amazingTest/violent-webdriver ## Basic Information - **Project Name**: violent-webdriver - **Description**: violent-webdriver 诞生于二次封装 selenium webdriver,内部封装了许多方法来确保浏览器操作的执行性,你不需要去担心定位到的元素是否存在于当前页面或者元素是否在当前时刻处于可点击状态,报错重试机制可以帮你自动解决这些不必要的麻烦。 - **Primary Language**: Python - **License**: AGPL-3.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 60 - **Forks**: 18 - **Created**: 2019-10-12 - **Last Updated**: 2025-02-07 ## Categories & Tags **Categories**: testing **Tags**: None ## README # violent-webdriver ![](https://img.shields.io/badge/-%20marvelous-orange) ![](https://img.shields.io/badge/-%20gogeous-grey) ![](https://img.shields.io/badge/-%20elegant-blue) ![输入图片说明](https://images.gitee.com/uploads/images/2019/1012/210805_592d6406_5239689.png "violentdriver.png") violent-webdriver 诞生于二次封装 selenium webdriver,内部封装了许多方法来确保浏览器操作的执行性,你不需要去担心定位到的元素是否存在于当前页面或者元素是否在当前时刻处于可点击状态,报错重试机制可以帮你自动解决这些不必要的麻烦。 ## 捐赠 | 支持 > [【捐赠支持(微信)】](https://images.gitee.com/uploads/images/2019/0819/234228_4c768444_5239689.jpeg "wechatDonation.jpg") > [【捐赠支持(支付宝)】](https://images.gitee.com/uploads/images/2019/0915/151226_cfd492fc_5239689.jpeg "支付宝收款二维码.jpg") > 如果你喜欢这个项目,那就点击一下右上方的【Star】以及【Fork】,支持一下吧! ## 安装 直接 pip install 即可,请先确保 Chrome 版本号与 driver 对应: $ pip install selenium $ pip install violent-webdriver ## 最佳实践 首先我们创建一个 python 文件: c:\folder\mytest.py # c:\folder\mytest.py from violent_webdriver import Chrome dr = Chrome.violent_chromedriver(executable_path=[CHROMEDRIVER_PATH], use_mobile_emulation=True) dr.get('http://www.baidu.com') dr.v_send_keys(locate_rule={'css selector': 'input[name=\'word\']'}, message='test') dr.v_click(locate_rule={'css selector': 'button[class=\'se-bn\']'}) 运行下列命令 $ python c:\folder\mytest.py 运行成功的话,可以看到模拟移动端后的 **test** 搜索结果 更多例子可参考 examples 目录下的代码~ ## 联系我 ![输入图片说明](https://images.gitee.com/uploads/images/2019/1012/205927_1d23cdf3_5239689.jpeg "publicAcount.jpg")