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
4a2457a9
Commit
4a2457a9
authored
Apr 20, 2024
by
huangziyu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
4ea23759
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
36 additions
and
17 deletions
+36
-17
京东搜索_手动验证版_0.py
京东搜索_手动验证版_0.py
+9
-8
京东搜索_手动验证版_1.py
京东搜索_手动验证版_1.py
+3
-1
京东搜索_手动验证版_2.py
京东搜索_手动验证版_2.py
+3
-1
京东搜索_手动验证版_3.py
京东搜索_手动验证版_3.py
+3
-1
京东搜索_手动验证版_4.py
京东搜索_手动验证版_4.py
+3
-1
京东搜索_手动验证版_5.py
京东搜索_手动验证版_5.py
+3
-1
京东搜索_手动验证版_6.py
京东搜索_手动验证版_6.py
+3
-1
京东搜索_手动验证版_7.py
京东搜索_手动验证版_7.py
+3
-1
京东搜索_手动验证版_8.py
京东搜索_手动验证版_8.py
+3
-1
京东搜索_手动验证版_9.py
京东搜索_手动验证版_9.py
+3
-1
No files found.
京东搜索_手动验证版_0.py
View file @
4a2457a9
...
...
@@ -66,7 +66,7 @@ def mysql_zdzs_proxy(sql=None):
return
[]
def
get_cookie
(
username
=
None
,
password
=
None
,
driver
=
None
):
def
get_cookie
(
username
=
None
,
password
=
None
,
driver
=
None
):
# driver.maximize_window()
driver
.
get
(
'https://passport.jd.com/uc/login'
)
print
(
f
"清空文本框开始"
)
...
...
@@ -130,13 +130,13 @@ def get_cookie(username=None,password=None,driver=None):
dataList
=
[]
try
:
for
x
in
Response
.
xpath
(
"//div[@id='J_goodsList']/ul/li"
):
is_self_operate_div
=
''
if
x
.
xpath
(
".//div[@class='p-name p-name-type-2']"
):
shop_name
=
x
.
xpath
(
".//span[@class='J_im_icon']/a/@title"
)[
0
]
if
x
.
xpath
(
".//span[@class='J_im_icon']/a/@title"
)
else
''
dataList
.
append
(
{
'is_self_operate_div'
:
is_self_operate_div
,
...
...
@@ -148,7 +148,7 @@ def get_cookie(username=None,password=None,driver=None):
"'"
))
.
strip
(),
'sku_price'
:
x
.
xpath
(
".//div[@class='p-price']//i//text()"
)[
0
]
}
)
insert_sql
=
f
"""
INSERT INTO DMP_SEARCH_DATA(id,result,mallId)
...
...
@@ -174,11 +174,13 @@ if __name__ == "__main__":
option
.
add_argument
(
"--disable-blink-features=AutomationControlled"
)
driver
.
set_window_size
(
1200
,
600
)
# get_cookie(username=config.account_list[0]['username'],password=config.account_list[0]['password'],driver=driver)
account_start_index
=
len
(
config
.
account_list
)
%
0
get_cookie
(
username
=
config
.
account_list
[
account_start_index
][
'username'
],
password
=
config
.
account_list
[
account_start_index
][
'password'
],
driver
=
driver
)
while
True
:
for
account
in
config
.
account_list
:
username
=
account
[
'username'
]
# 登陆密码
password
=
account
[
'password'
]
print
(
f
"切换账号:{username}"
)
get_cookie
(
username
=
username
,
password
=
password
,
driver
=
driver
)
driver
.
quit
()
\ No newline at end of file
get_cookie
(
username
=
username
,
password
=
password
,
driver
=
driver
)
driver
.
quit
()
京东搜索_手动验证版_1.py
View file @
4a2457a9
...
...
@@ -173,7 +173,9 @@ if __name__ == "__main__":
driver
=
webdriver
.
Chrome
(
options
=
option
)
option
.
add_argument
(
"--disable-blink-features=AutomationControlled"
)
driver
.
set_window_size
(
1200
,
600
)
# get_cookie(username=config.account_list[0]['username'],password=config.account_list[0]['password'],driver=driver)
account_start_index
=
len
(
config
.
account_list
)
%
1
get_cookie
(
username
=
config
.
account_list
[
account_start_index
][
'username'
],
password
=
config
.
account_list
[
account_start_index
][
'password'
],
driver
=
driver
)
while
True
:
for
account
in
config
.
account_list
:
username
=
account
[
'username'
]
...
...
京东搜索_手动验证版_2.py
View file @
4a2457a9
...
...
@@ -173,7 +173,9 @@ if __name__ == "__main__":
driver
=
webdriver
.
Chrome
(
options
=
option
)
option
.
add_argument
(
"--disable-blink-features=AutomationControlled"
)
driver
.
set_window_size
(
1200
,
600
)
# get_cookie(username=config.account_list[0]['username'],password=config.account_list[0]['password'],driver=driver)
account_start_index
=
len
(
config
.
account_list
)
%
2
get_cookie
(
username
=
config
.
account_list
[
account_start_index
][
'username'
],
password
=
config
.
account_list
[
account_start_index
][
'password'
],
driver
=
driver
)
while
True
:
for
account
in
config
.
account_list
:
username
=
account
[
'username'
]
...
...
京东搜索_手动验证版_3.py
View file @
4a2457a9
...
...
@@ -173,7 +173,9 @@ if __name__ == "__main__":
driver
=
webdriver
.
Chrome
(
options
=
option
)
option
.
add_argument
(
"--disable-blink-features=AutomationControlled"
)
driver
.
set_window_size
(
1200
,
600
)
# get_cookie(username=config.account_list[0]['username'],password=config.account_list[0]['password'],driver=driver)
account_start_index
=
len
(
config
.
account_list
)
%
3
get_cookie
(
username
=
config
.
account_list
[
account_start_index
][
'username'
],
password
=
config
.
account_list
[
account_start_index
][
'password'
],
driver
=
driver
)
while
True
:
for
account
in
config
.
account_list
:
username
=
account
[
'username'
]
...
...
京东搜索_手动验证版_4.py
View file @
4a2457a9
...
...
@@ -173,7 +173,9 @@ if __name__ == "__main__":
driver
=
webdriver
.
Chrome
(
options
=
option
)
option
.
add_argument
(
"--disable-blink-features=AutomationControlled"
)
driver
.
set_window_size
(
1200
,
600
)
# get_cookie(username=config.account_list[0]['username'],password=config.account_list[0]['password'],driver=driver)
account_start_index
=
len
(
config
.
account_list
)
%
4
get_cookie
(
username
=
config
.
account_list
[
account_start_index
][
'username'
],
password
=
config
.
account_list
[
account_start_index
][
'password'
],
driver
=
driver
)
while
True
:
for
account
in
config
.
account_list
:
username
=
account
[
'username'
]
...
...
京东搜索_手动验证版_5.py
View file @
4a2457a9
...
...
@@ -173,7 +173,9 @@ if __name__ == "__main__":
driver
=
webdriver
.
Chrome
(
options
=
option
)
option
.
add_argument
(
"--disable-blink-features=AutomationControlled"
)
driver
.
set_window_size
(
1200
,
600
)
# get_cookie(username=config.account_list[0]['username'],password=config.account_list[0]['password'],driver=driver)
account_start_index
=
len
(
config
.
account_list
)
%
5
get_cookie
(
username
=
config
.
account_list
[
account_start_index
][
'username'
],
password
=
config
.
account_list
[
account_start_index
][
'password'
],
driver
=
driver
)
while
True
:
for
account
in
config
.
account_list
:
username
=
account
[
'username'
]
...
...
京东搜索_手动验证版_6.py
View file @
4a2457a9
...
...
@@ -173,7 +173,9 @@ if __name__ == "__main__":
driver
=
webdriver
.
Chrome
(
options
=
option
)
option
.
add_argument
(
"--disable-blink-features=AutomationControlled"
)
driver
.
set_window_size
(
1200
,
600
)
# get_cookie(username=config.account_list[0]['username'],password=config.account_list[0]['password'],driver=driver)
account_start_index
=
len
(
config
.
account_list
)
%
6
get_cookie
(
username
=
config
.
account_list
[
account_start_index
][
'username'
],
password
=
config
.
account_list
[
account_start_index
][
'password'
],
driver
=
driver
)
while
True
:
for
account
in
config
.
account_list
:
username
=
account
[
'username'
]
...
...
京东搜索_手动验证版_7.py
View file @
4a2457a9
...
...
@@ -173,7 +173,9 @@ if __name__ == "__main__":
driver
=
webdriver
.
Chrome
(
options
=
option
)
option
.
add_argument
(
"--disable-blink-features=AutomationControlled"
)
driver
.
set_window_size
(
1200
,
600
)
# get_cookie(username=config.account_list[0]['username'],password=config.account_list[0]['password'],driver=driver)
account_start_index
=
len
(
config
.
account_list
)
%
7
get_cookie
(
username
=
config
.
account_list
[
account_start_index
][
'username'
],
password
=
config
.
account_list
[
account_start_index
][
'password'
],
driver
=
driver
)
while
True
:
for
account
in
config
.
account_list
:
username
=
account
[
'username'
]
...
...
京东搜索_手动验证版_8.py
View file @
4a2457a9
...
...
@@ -173,7 +173,9 @@ if __name__ == "__main__":
driver
=
webdriver
.
Chrome
(
options
=
option
)
option
.
add_argument
(
"--disable-blink-features=AutomationControlled"
)
driver
.
set_window_size
(
1200
,
600
)
# get_cookie(username=config.account_list[0]['username'],password=config.account_list[0]['password'],driver=driver)
account_start_index
=
len
(
config
.
account_list
)
%
8
get_cookie
(
username
=
config
.
account_list
[
account_start_index
][
'username'
],
password
=
config
.
account_list
[
account_start_index
][
'password'
],
driver
=
driver
)
while
True
:
for
account
in
config
.
account_list
:
username
=
account
[
'username'
]
...
...
京东搜索_手动验证版_9.py
View file @
4a2457a9
...
...
@@ -173,7 +173,9 @@ if __name__ == "__main__":
driver
=
webdriver
.
Chrome
(
options
=
option
)
option
.
add_argument
(
"--disable-blink-features=AutomationControlled"
)
driver
.
set_window_size
(
1200
,
600
)
# get_cookie(username=config.account_list[0]['username'],password=config.account_list[0]['password'],driver=driver)
account_start_index
=
len
(
config
.
account_list
)
%
9
get_cookie
(
username
=
config
.
account_list
[
account_start_index
][
'username'
],
password
=
config
.
account_list
[
account_start_index
][
'password'
],
driver
=
driver
)
while
True
:
for
account
in
config
.
account_list
:
username
=
account
[
'username'
]
...
...
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