Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
checkData
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
ZGC_INDEX
checkData
Commits
666b5380
Commit
666b5380
authored
Feb 18, 2020
by
rico.liu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SN price problem
parent
e17ae2ae
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
11 deletions
+14
-11
checkData.py
checkData.py
+14
-11
No files found.
checkData.py
View file @
666b5380
...
@@ -62,7 +62,7 @@ def checkData(check_data):
...
@@ -62,7 +62,7 @@ def checkData(check_data):
source
=
df
[
'source'
]
source
=
df
[
'source'
]
price
=
df
[
'price'
]
price
=
df
[
'price'
]
brand
=
df
[
'brand'
]
brand
=
df
[
'brand'
]
subcategory
=
df
[
'
sub
category'
]
subcategory
=
df
[
'category'
]
print
(
main_url
)
print
(
main_url
)
if
"jd"
in
str
(
main_url
):
if
"jd"
in
str
(
main_url
):
try
:
try
:
...
@@ -237,7 +237,7 @@ def checkData(check_data):
...
@@ -237,7 +237,7 @@ def checkData(check_data):
elif
"suning"
in
str
(
main_url
):
elif
"suning"
in
str
(
main_url
):
try
:
try
:
main_url
=
'http://product.suning.com/0000000000/11673575307.html'
sku
=
re
.
findall
(
".com/(.*?).html"
,
main_url
)[
0
]
sku
=
re
.
findall
(
".com/(.*?).html"
,
main_url
)[
0
]
main_url_
=
'https://product.suning.com/'
+
sku
+
'.html'
main_url_
=
'https://product.suning.com/'
+
sku
+
'.html'
r
=
get_response
(
session
,
main_url_
,
headers
)
r
=
get_response
(
session
,
main_url_
,
headers
)
...
@@ -283,7 +283,8 @@ def checkData(check_data):
...
@@ -283,7 +283,8 @@ def checkData(check_data):
real_url
=
f
'https://pas.suning.com/nspcsale_0_{str11}_{str11}_{str22}_10_010_0100100_157122_1000000_9017_10106_Z001___{str33}.html?callback=pcData'
real_url
=
f
'https://pas.suning.com/nspcsale_0_{str11}_{str11}_{str22}_10_010_0100100_157122_1000000_9017_10106_Z001___{str33}.html?callback=pcData'
price_response
=
requests
.
get
(
real_url
)
price_response
=
requests
.
get
(
real_url
)
sn_price
=
re
.
findall
(
'"promotionPrice":"(.*?)",'
,
price_response
.
text
)[
0
]
sn_price
=
re
.
findall
(
'"promotionPrice":"(.*?)",'
,
price_response
.
text
)[
0
]
if
len
(
sn_price
)
!=
0
:
sn_price
=
price
#if len(sn_price) != 0:
price_list
.
append
(
sn_price
)
price_list
.
append
(
sn_price
)
print
(
'通过'
)
print
(
'通过'
)
result
.
append
(
'通过'
)
result
.
append
(
'通过'
)
...
@@ -292,6 +293,7 @@ def checkData(check_data):
...
@@ -292,6 +293,7 @@ def checkData(check_data):
name_list
.
append
(
name
)
name_list
.
append
(
name
)
url_list
.
append
(
main_url
)
url_list
.
append
(
main_url
)
source_list
.
append
(
source
)
source_list
.
append
(
source
)
'''
else:
else:
sn_price = price
sn_price = price
price_list.append(sn_price)
price_list.append(sn_price)
...
@@ -302,6 +304,7 @@ def checkData(check_data):
...
@@ -302,6 +304,7 @@ def checkData(check_data):
name_list.append(name)
name_list.append(name)
url_list.append(main_url)
url_list.append(main_url)
source_list.append(source)
source_list.append(source)
'''
else
:
else
:
print
(
'无货,请按要求提供在销渠道证明'
)
print
(
'无货,请按要求提供在销渠道证明'
)
...
...
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