Commit 60847175 authored by huangziyu's avatar huangziyu

1

parent 4fa74ede
This diff is collapsed.
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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment