Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
泰斯特Test
violent-webdriver
提交
50707fc0
V
violent-webdriver
项目概览
泰斯特Test
/
violent-webdriver
通知
4
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
violent-webdriver
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
50707fc0
编写于
6月 28, 2018
作者:
泰斯特Test
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update version
上级
586c3078
变更
8
展开全部
隐藏空白更改
内联
并排
Showing
8 changed file
with
305 addition
and
324 deletion
+305
-324
README.md
README.md
+4
-4
examples/get_text_example.py
examples/get_text_example.py
+1
-1
examples/is_opened_new_window_example.py
examples/is_opened_new_window_example.py
+3
-3
examples/is_page_refreshed_example.py
examples/is_page_refreshed_example.py
+2
-2
examples/multi_locate_example.py
examples/multi_locate_example.py
+2
-2
examples/single_locate_example.py
examples/single_locate_example.py
+2
-2
setup.py
setup.py
+1
-1
violent_webdriver/Chrome.py
violent_webdriver/Chrome.py
+290
-309
未找到文件。
README.md
浏览文件 @
50707fc0
...
...
@@ -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=[C
hromedriver_Path
], use_mobile_emulation=True)
dr = Chrome.violent_chromedriver(executable_path=[C
HROMEDRIVER_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
...
...
examples/get_text_example.py
浏览文件 @
50707fc0
...
...
@@ -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/'
}
))
examples/is_opened_new_window_example.py
浏览文件 @
50707fc0
...
...
@@ -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
())
examples/is_page_refreshed_example.py
浏览文件 @
50707fc0
...
...
@@ -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
))
examples/multi_locate_example.py
浏览文件 @
50707fc0
...
...
@@ -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'
:
'百度一下'
}
)
examples/single_locate_example.py
浏览文件 @
50707fc0
...
...
@@ -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'
}
)
setup.py
浏览文件 @
50707fc0
...
...
@@ -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"
,
...
...
violent_webdriver/Chrome.py
浏览文件 @
50707fc0
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录