Commit 5f70947c authored by huangiyu's avatar huangiyu

初始化

parent e65fa1fb
...@@ -112,7 +112,7 @@ class SlideUtils: ...@@ -112,7 +112,7 @@ class SlideUtils:
y += random.randint(-9, 0) y += random.randint(-9, 0)
pyautogui.moveTo(x + int(offset * random.randint(17, 21) / 20), y, duration=random.randint(20, 31) / 100) pyautogui.moveTo(x + int(offset * random.randint(17, 21) / 20), y, duration=random.randint(20, 31) / 100)
y += random.randint(0, 8) y += random.randint(0, 8)
pyautogui.moveTo(xx, y, duration=0.3) pyautogui.moveTo(xx, y, duration=1.5)
pyautogui.mouseUp() pyautogui.mouseUp()
@staticmethod @staticmethod
...@@ -130,7 +130,7 @@ class SlideUtils: ...@@ -130,7 +130,7 @@ class SlideUtils:
y += random.randint(-9, 0) y += random.randint(-9, 0)
pyautogui.moveTo(x + int(offset * random.randint(17, 21) / 20), y, duration=random.randint(20, 31) / 100) pyautogui.moveTo(x + int(offset * random.randint(17, 21) / 20), y, duration=random.randint(20, 31) / 100)
y += random.randint(0, 8) y += random.randint(0, 8)
pyautogui.moveTo(xx, y, duration=0.3) pyautogui.moveTo(xx, y, duration=1.5)
# print("睡眠2秒后松开") # print("睡眠2秒后松开")
# time.sleep(0.3) # time.sleep(0.3)
pyautogui.mouseUp() pyautogui.mouseUp()
...@@ -297,8 +297,9 @@ def get_cookie(): ...@@ -297,8 +297,9 @@ def get_cookie():
# 其中x为屏幕左上角至滑块中心的横向像素值,y为屏幕左上角至滑块中心纵向像素值, 可根据自己屏幕配置 # 其中x为屏幕左上角至滑块中心的横向像素值,y为屏幕左上角至滑块中心纵向像素值, 可根据自己屏幕配置
SlideUtils.slide_by_pyautogui(slide_x_position, slid_y_position, x, offset_increase) SlideUtils.slide_by_pyautogui(slide_x_position, slid_y_position, x, offset_increase)
time.sleep(3) time.sleep(3)
query_spider_sql = f"SELECT id,url,mallId FROM DMP_SEARCH_SPIDER WHERE ID NOT IN (SELECT ID FROM DMP_SEARCH_DATA) and mallId = 'DS-JD' and project_id = '110' order by docID desc limit 10000" # query_spider_sql = f"SELECT id,url,mallId FROM DMP_SEARCH_SPIDER WHERE ID NOT IN (SELECT ID FROM DMP_SEARCH_DATA) and mallId = 'DS-JD' and project_id = '110' order by docID desc limit 10000"
# query_spider_sql = f"SELECT id,url,mallId FROM DMP_SEARCH_SPIDER WHERE data_batch ='202401251550270001' and ID NOT IN (SELECT ID FROM DMP_SEARCH_DATA) and mallId = 'DS-JD' order by docID desc limit 10000" # query_spider_sql = f"SELECT id,url,mallId FROM DMP_SEARCH_SPIDER WHERE data_batch ='202401251550270001' and ID NOT IN (SELECT ID FROM DMP_SEARCH_DATA) and mallId = 'DS-JD' order by docID desc limit 10000"
query_spider_sql = f"SELECT id,url,mallId FROM DMP_SEARCH_SPIDER WHERE ID NOT IN (SELECT ID FROM DMP_SEARCH_DATA) and mallId = 'DS-JD' order by docID desc limit 1000"
query_spider = mysql_zdzs_proxy(query_spider_sql) query_spider = mysql_zdzs_proxy(query_spider_sql)
for row in query_spider: for row in query_spider:
# while True: # while True:
...@@ -309,11 +310,10 @@ def get_cookie(): ...@@ -309,11 +310,10 @@ def get_cookie():
url = row['url'] url = row['url']
print(url) print(url)
driver.get(url) driver.get(url)
time.sleep(1)
text = driver.page_source text = driver.page_source
while ('快速验证' in text and '验证一下,购物无忧' in text) or '前方拥挤,请刷新重试' in text: while ('快速验证' in text and '验证一下,购物无忧' in text) or '前方拥挤,请刷新重试' in text:
driver.get(url) driver.get(url)
time.sleep(1) time.sleep(1.5)
pass pass
# 获取验证码图片 # 获取验证码图片
try: try:
......
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