Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
A
Appium-crawl
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
李康
Appium-crawl
Commits
9b1d700d
Commit
9b1d700d
authored
Oct 18, 2019
by
李康
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
adjust scroll parameters
parent
2788ec35
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
+6
-3
product.py
product.py
+6
-3
No files found.
product.py
View file @
9b1d700d
...
...
@@ -4,6 +4,7 @@ import numpy as np
import
sys
,
os
,
time
delim
=
"; "
filter_scroll_steps
=
2
def
clickBrand
(
d
,
brand_name
):
print
(
"Try finding brand
%
s......"
%
brand_name
)
...
...
@@ -65,16 +66,17 @@ def getAllFilterTypes(d):
new_flag
=
True
ftype_names
.
append
(
ftype
.
get_text
())
if
new_flag
:
filter_pane
.
scroll
.
vert
(
steps
=
10
)
filter_pane
.
scroll
.
vert
(
steps
=
filter_scroll_steps
)
else
:
break
filter_pane
.
scroll
.
vert
.
backward
()
return
ftype_names
def
filterProduct
(
d
,
ftype_name
):
print
(
"Select the filter type
%
s"
%
ftype_name
)
ftype
=
d
(
resourceId
=
"org.c2h4.afei.beauty:id/tv_type"
,
text
=
ftype_name
)
while
ftype
.
count
==
0
:
d
(
scrollable
=
True
)
.
scroll
(
steps
=
10
)
d
(
scrollable
=
True
)
.
scroll
(
steps
=
filter_scroll_steps
)
ftype
=
d
(
resourceId
=
"org.c2h4.afei.beauty:id/tv_type"
,
text
=
ftype_name
)
ftype
.
click
()
...
...
@@ -304,11 +306,12 @@ def getProductByType(argv):
scraped_cnt
=
0
with
open
(
brand_name
+
"/products.csv"
,
'a+'
)
as
f
:
ftype_names
=
getAllFilterTypes
(
d
)
print
(
"All the brand sub-types:"
)
for
ftype_name
in
ftype_names
:
print
(
ftype_name
)
for
ftype_name
in
ftype_names
:
# if ftype_name != "
护肤水
":
# if ftype_name != "
粉底·BB霜
":
# continue
filterProduct
(
d
,
ftype_name
)
time
.
sleep
(
1
)
...
...
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