Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
京
京东搜索采集自动验证
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
黄梓誉
京东搜索采集自动验证
Commits
60bf6bc9
Commit
60bf6bc9
authored
Apr 18, 2024
by
huangziyu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
b9e730ec
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
30 deletions
+12
-30
京东搜索_自动版.py
京东搜索_自动版.py
+12
-30
No files found.
京东搜索_自动版.py
View file @
60bf6bc9
...
@@ -107,8 +107,8 @@ class SlideUtils:
...
@@ -107,8 +107,8 @@ class SlideUtils:
"""
"""
使用pyautogui实现滑块并自定义轨迹方程
使用pyautogui实现滑块并自定义轨迹方程
"""
"""
print
(
f
"睡眠
2
.5秒后点击移动"
)
print
(
f
"睡眠
0
.5秒后点击移动"
)
time
.
sleep
(
2
.5
)
time
.
sleep
(
0
.5
)
xx
=
x
+
offset
+
offset_increase
xx
=
x
+
offset
+
offset_increase
pyautogui
.
moveTo
(
x
,
y
,
duration
=
0.1
)
pyautogui
.
moveTo
(
x
,
y
,
duration
=
0.1
)
pyautogui
.
mouseDown
()
pyautogui
.
mouseDown
()
...
@@ -116,27 +116,8 @@ class SlideUtils:
...
@@ -116,27 +116,8 @@ class SlideUtils:
pyautogui
.
moveTo
(
x
+
int
(
offset
*
random
.
randint
(
15
,
23
)
/
20
),
y
,
duration
=
0.28
)
pyautogui
.
moveTo
(
x
+
int
(
offset
*
random
.
randint
(
15
,
23
)
/
20
),
y
,
duration
=
0.28
)
y
+=
random
.
randint
(
-
9
,
0
)
y
+=
random
.
randint
(
-
9
,
0
)
pyautogui
.
moveTo
(
x
+
int
(
offset
*
random
.
randint
(
17
,
21
)
/
20
),
y
,
duration
=
random
.
randint
(
20
,
31
)
/
100
)
pyautogui
.
moveTo
(
x
+
int
(
offset
*
random
.
randint
(
17
,
21
)
/
20
),
y
,
duration
=
random
.
randint
(
20
,
31
)
/
100
)
y
+=
random
.
randint
(
-
3
,
3
)
y
+=
random
.
randint
(
0
,
8
)
pyautogui
.
moveTo
(
xx
,
y
,
duration
=
0.8
)
pyautogui
.
moveTo
(
xx
,
y
,
duration
=
1.5
)
print
(
"睡眠1秒后松开"
)
time
.
sleep
(
0.2
)
import
math
move_range
=
15
while_count
=
0
while
while_count
<
3
:
while_count
+=
1
move_x
=
random
.
randint
(
-
move_range
,
move_range
)
# 生成随机的上下移动距离
move_y
=
random
.
randint
(
-
10
,
10
)
# 移动鼠标
pyautogui
.
moveRel
(
move_x
,
move_y
,
duration
=
0.2
)
time
.
sleep
(
0.2
)
# 停顿一段时间
# 回到原始位置
pyautogui
.
moveTo
(
xx
,
y
,
duration
=
0.2
)
time
.
sleep
(
0.2
)
# 停顿一段时间
print
(
"松开"
)
pyautogui
.
mouseUp
()
pyautogui
.
mouseUp
()
@
staticmethod
@
staticmethod
...
@@ -144,18 +125,19 @@ class SlideUtils:
...
@@ -144,18 +125,19 @@ class SlideUtils:
"""
"""
使用pyautogui实现滑块并自定义轨迹方程
使用pyautogui实现滑块并自定义轨迹方程
"""
"""
# print(f"睡眠2秒后点击移动")
# time.sleep(2)
xx
=
x
+
offset
+
offset_increase
xx
=
x
+
offset
+
offset_increase
pyautogui
.
moveTo
(
x
,
y
,
duration
=
0.
3
)
pyautogui
.
moveTo
(
x
,
y
,
duration
=
0.
1
)
pyautogui
.
mouseDown
()
pyautogui
.
mouseDown
()
y
+=
random
.
randint
(
9
,
19
)
y
+=
random
.
randint
(
9
,
19
)
pyautogui
.
moveTo
(
x
+
int
(
offset
*
random
.
randint
(
15
,
23
)
/
20
),
y
,
duration
=
0.
5
)
pyautogui
.
moveTo
(
x
+
int
(
offset
*
random
.
randint
(
15
,
23
)
/
20
),
y
,
duration
=
0.
28
)
y
+=
random
.
randint
(
-
9
,
0
)
y
+=
random
.
randint
(
-
9
,
0
)
pyautogui
.
moveTo
(
x
+
int
(
offset
*
random
.
randint
(
17
,
21
)
/
20
),
y
,
duration
=
random
.
randint
(
20
,
31
)
/
100
)
pyautogui
.
moveTo
(
x
+
int
(
offset
*
random
.
randint
(
17
,
21
)
/
20
),
y
,
duration
=
random
.
randint
(
20
,
31
)
/
100
)
pyautogui
.
moveTo
(
xx
+
random
.
randint
(
-
2
,
2
),
y
,
duration
=
0.8
)
y
+=
random
.
randint
(
0
,
8
)
duration
=
random
.
randint
(
50
,
99
)
/
100
pyautogui
.
moveTo
(
xx
,
y
,
duration
=
1.5
)
print
(
duration
)
# print("睡眠2秒后松开")
pyautogui
.
moveRel
(
0
,
random
.
randint
(
2
,
20
),
duration
=
duration
)
# time.sleep(0.3)
print
(
"松开"
)
pyautogui
.
mouseUp
()
pyautogui
.
mouseUp
()
# print(f"睡眠2秒后点击
# print(f"睡眠2秒后点击
# time.sleep(2)
# time.sleep(2)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment