基于selenium的暴力webdriver
violent-webdriver的Python项目详细描述
#暴力网络司机 暴力webdriver是通过后打包selenium webdriver创建的,暴力webdriver有很多方便的功能 这可以很好地保证浏览器操作,您不必担心元素是否真的存在 在当前页面上或使用暴力网络驱动程序时在特定时间单击。它会处理这种事情的 烦人的问题
在github上查找最新版本:https://github.com/amazingTest/violent-webdriver
##安装 上一个稳定版本在pypi上可用,可以与pip一起安装。 确保已安装chrome并与selenium版本匹配
$ pip install selenium
$ pip install violent-webdriver
##最佳实践 首先,创建一个python文件:c:foldermytest.py
# c:foldermytest.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’]’})
然后使用IDE运行此脚本或
$ python c:foldermytest.py
如果成功,您将通过移动模拟浏览器看到“test”的搜索结果
有关更多代码示例,请参阅源发行版中的examples文件夹或 访问https://github.com/amazingTest/violent-webdriver/tree/master/examples
##联系我 有关信息和建议,请致电523314409@qq.com