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
60847175
Commit
60847175
authored
Jun 22, 2024
by
huangziyu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
4fa74ede
Changes
2
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
123 additions
and
10 deletions
+123
-10
config.py
config.py
+21
-10
查询剩余京东搜索链接量.py
查询剩余京东搜索链接量.py
+102
-0
No files found.
config.py
View file @
60847175
This diff is collapsed.
Click to expand it.
查询剩余京东搜索链接量.py
0 → 100644
View file @
60847175
import
time
from
urllib
import
request
import
cv2
from
putCookies
import
updateCookie
import
numpy
as
np
import
pyautogui
from
selenium
import
webdriver
from
selenium.common.exceptions
import
NoSuchElementException
from
selenium.webdriver
import
ChromeOptions
from
selenium.webdriver.support.ui
import
WebDriverWait
from
selenium.webdriver.support
import
expected_conditions
as
EC
import
pymysql
from
lxml
import
etree
# 登陆账号
from
selenium.webdriver.common.by
import
By
import
openpyxl
import
time
import
random
import
json
from
openpyxl
import
Workbook
from
PIL
import
Image
import
re
from
bs4
import
BeautifulSoup
# from utils.spider import jd
mysql_zdzs_proxy_host
=
'59.110.219.171'
mysql_zdzs_proxy_user
=
'zgcindex'
mysql_zdzs_proxy_password
=
'zgcprice2019'
mysql_zdzs_proxy_database
=
'zdzs_proxy'
import
config
username
=
config
.
username
# 登陆密码
password
=
config
.
password
# mysql_zdzs_proxy_host = '59.110.219.171'
# mysql_zdzs_proxy_user = 'zgcindex'
# mysql_zdzs_proxy_password = 'zgcprice2019'
# mysql_zdzs_proxy_database = 'zdzs_proxy'
# 滑块距离屏幕左上角的x, y像素, 需根据自己屏幕大小调整,利用微信截图得到xy的具体位置
# 登录的
# slide_x_position, slid_y_position = 850, 459
# # 验证的
# slide_x_position_quick_verification, slid_y_position_quick_verification = 490, 512
# 偏移度加值(根据电脑分辨率情况)
offset_increase
=
0
while
True
:
try
:
conn
=
pymysql
.
connect
(
host
=
mysql_zdzs_proxy_host
,
user
=
mysql_zdzs_proxy_user
,
password
=
mysql_zdzs_proxy_password
,
database
=
mysql_zdzs_proxy_database
,
charset
=
"utf8mb4"
,
cursorclass
=
pymysql
.
cursors
.
DictCursor
,
autocommit
=
True
)
break
except
Exception
as
e
:
print
(
e
)
time
.
sleep
(
5
)
pass
cur
=
conn
.
cursor
()
def
mysql_zdzs_proxy
(
sql
=
None
):
print
(
sql
)
try
:
cur
.
execute
(
sql
)
result
=
cur
.
fetchall
()
return
result
except
pymysql
.
err
.
IntegrityError
as
e
:
# cur.close()
return
[]
except
Exception
as
e
:
print
(
f
"插入异常:{e}"
)
return
[]
if
__name__
==
'__main__'
:
print
(
mysql_zdzs_proxy
(
f
"""
SELECT
count(*)
FROM
DMP_SEARCH_SPIDER
WHERE
ID NOT IN (
SELECT
ID
FROM
DMP_SEARCH_DATA
)
AND
mallId = 'DS-JD'
{config.query_where_sql}
"""
))
# SELECT * FROM `DMP_SPIDER` where docId = '56033241';
# status = 0 就是若煜没跑
# and id like '%9'
# count(*)
# limit 10
\ No newline at end of file
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