提交 50707fc0 编写于 作者: 泰斯特Test's avatar 泰斯特Test

update version

上级 586c3078
......@@ -8,7 +8,7 @@ Find the latest version on github : https://github.com/amazingTest/violent-webdr
## Installation
The last stable release is available on PyPI and can be installed with pip.
**make sure that Chrome has been installed and match the selenium version**
**make sure that Chrome has been installed and match the selenium version**
$ pip install selenium
......@@ -20,10 +20,10 @@ Firstly, create a python file: 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 = Chrome.violent_chromedriver(executable_path=[CHROMEDRIVER_PATH], use_mobile_emulation=True)
dr.get('http://www.baidu.com')
dr.v_send_keys(locate_rule=[['tag', 'input'], ['name', 'word']], message='test')
dr.v_click(locate_rule=[['tag', 'button'], ['class', 'se-bn']])
dr.v_send_keys(locate_rule={'tag': 'input', 'name': 'word'}, message='test')
dr.v_click(locate_rule={'tag': 'button', 'class': 'se-bn'})
then use your IDE to run this script or
......
......@@ -3,4 +3,4 @@ from violent_webdriver import Chrome
# the value of executable_path should be your own path
dr = Chrome.violent_chromedriver(executable_path='C://MyDownloads/Download/chrome-win32/chromedriver.exe')
dr.get('https://www.baidu.com')
print(dr.v_get_text(locate_rule=[['tag', 'a'], ['href', 'http://www.baidu.com/more/']]))
print(dr.v_get_text(locate_rule={'tag': 'a', 'href': 'http://www.baidu.com/more/'}))
......@@ -3,7 +3,7 @@ from violent_webdriver import Chrome
# the value of executable_path should be your own path
dr = Chrome.violent_chromedriver(executable_path='C://MyDownloads/Download/chrome-win32/chromedriver.exe')
dr.get('https://www.baidu.com')
dr.v_send_keys(locate_rule=[['tag', 'input'], ['class', 's_ipt']], message='test')
dr.v_click(locate_rule=[['tag', 'input'], ['value', '百度一下']])
dr.v_click(locate_rule=[['tag', 'em'], ['text', 'test']])
dr.v_send_keys(locate_rule={'tag': 'input', 'class': 's_ipt'}, message='test')
dr.v_click(locate_rule={'tag': 'input', 'value': '百度一下'})
dr.v_click(locate_rule={'tag': 'em', 'text': 'test'})
print(dr.is_opened_new_window())
......@@ -5,6 +5,6 @@ dr = Chrome.violent_chromedriver(executable_path='C://MyDownloads/Download/chrom
dr.get('https://www.baidu.com')
dr.implicitly_wait(30)
trigger = dr.find_element_by_name('tj_trtieba')
dr.v_send_keys(locate_rule=[['tag', 'input'], ['class', 's_ipt']], message='test')
dr.v_click(locate_rule=[['tag', 'input'], ['value', '百度一下']])
dr.v_send_keys(locate_rule={'tag': 'input', 'class': 's_ipt'}, message='test')
dr.v_click(locate_rule={'tag': 'input', 'value': '百度一下'})
print(dr.is_page_refreshed(trigger))
......@@ -3,5 +3,5 @@ from violent_webdriver import Chrome
# the value of executable_path should be your own path
dr = Chrome.violent_chromedriver(executable_path='C://MyDownloads/Download/chrome-win32/chromedriver.exe')
dr.get('https://www.baidu.com')
dr.v_send_keys(locate_rule=[['tag', 'input'], ['class', 's_ipt']], message='test')
dr.v_click(locate_rule=[['tag', 'input'], ['value', '百度一下']])
dr.v_send_keys(locate_rule={'tag': 'input', 'class': 's_ipt'}, message='test')
dr.v_click(locate_rule={'tag': 'input', 'value': '百度一下'})
......@@ -3,5 +3,5 @@ from violent_webdriver import Chrome
# the value of executable_path should be your own path
dr = Chrome.violent_chromedriver(executable_path='C://MyDownloads/Download/chrome-win32/chromedriver.exe')
dr.get('https://www.baidu.com')
dr.v_send_keys(locate_rule=[['name', 'wd']], message='test')
dr.v_click(locate_rule=[['id', 'su']])
dr.v_send_keys(locate_rule={'name': 'wd'}, message='test')
dr.v_click(locate_rule={'id': 'su'})
......@@ -5,7 +5,7 @@ with open("README.md", "r") as fh:
setuptools.setup(
name="violent-webdriver",
version="1.0.7",
version="1.0.8",
author="Yuyi Shao",
author_email="523314409@qq.com",
description="violent webdriver based on selenium",
......
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册