From b9dfbbcbda2bf968d864a31e2fd2220928cd079a Mon Sep 17 00:00:00 2001 From: chenwj113 Date: Tue, 1 Nov 2022 15:14:04 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20auto.py=E5=A2=9E=E5=8A=A0=E6=89=8B?= =?UTF-8?q?=E6=9C=BA=E6=A8=A1=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- auto.py | 34 ++++++++++++++++++++++++++-------- pls.py | 6 ++---- 2 files changed, 28 insertions(+), 12 deletions(-) diff --git a/auto.py b/auto.py index a8c58cf..54c4cd8 100644 --- a/auto.py +++ b/auto.py @@ -1,7 +1,13 @@ -from helium import * import time -driver = start_chrome("https://youdian.jindianle.com/", headless=True) +from helium import * +from selenium.webdriver import ChromeOptions + +chrome_options = ChromeOptions() +mobile_emulation = {'deviceName': 'iPhone XR'} +chrome_options.add_experimental_option("mobileEmulation", mobile_emulation) + +driver = start_chrome("https://youdian.jindianle.com/", headless=True, options=chrome_options) click(Text("您尚未登录,点击登录")) click(Text("密码登录")) write("15359827092", into="请输入手机号") @@ -10,11 +16,23 @@ click(Button("登 录")) # 进入页面先点击关闭弹窗按钮 _close = S('//*[@id="vue2_el"]/div/div[10]/div/p') click(_close) -# 点击竞彩足球 -jczq = S('//*[@id="vue2_el"]/div/section/div[6]/div[2]/div[1]/a/p/em') -click(jczq) -fenxi_list = find_all(Text("分析")) -print(fenxi_list) -# click(fenxi_list[0]) + +# +pls = S('//*[@id="vue2_el"]/div/section/div[6]/div[4]/div[3]') +group3 = S('#body > section > div.betmain.betmain_p3zx > div.betmain_p3zxmenu.topcenter > p:nth-child(1)') +click(pls) +click(Text('组选')) + +ball_0 = S('#body > section > div.betmain.betmain_p3zx > div.betmain_p3zxball > ul > li:nth-child(1) > p.ballline') +ball_1 = S('#body > section > div.betmain.betmain_p3zx > div.betmain_p3zxball > ul > li:nth-child(2) > p.ballline') +ball_2 = S('#body > section > div.betmain.betmain_p3zx > div.betmain_p3zxball > ul > li:nth-child(3) > p.ballline') +ball_3 = S('#body > section > div.betmain.betmain_p3zx > div.betmain_p3zxball > ul > li:nth-child(4) > p.ballline') +ball_4 = S('#body > section > div.betmain.betmain_p3zx > div.betmain_p3zxball > ul > li:nth-child(5) > p.ballline') +ball_5 = S('#body > section > div.betmain.betmain_p3zx > div.betmain_p3zxball > ul > li:nth-child(6) > p.ballline') +ball_6 = S('#body > section > div.betmain.betmain_p3zx > div.betmain_p3zxball > ul > li:nth-child(7) > p.ballline') +ball_7 = S('#body > section > div.betmain.betmain_p3zx > div.betmain_p3zxball > ul > li:nth-child(8) > p.ballline') +ball_8 = S('#body > section > div.betmain.betmain_p3zx > div.betmain_p3zxball > ul > li:nth-child(9) > p.ballline') +ball_9 = S('#body > section > div.betmain.betmain_p3zx > div.betmain_p3zxball > ul > li:nth-child(10) > p.ballline') + # time.sleep(5) # kill_browser() \ No newline at end of file diff --git a/pls.py b/pls.py index b342fa0..95f4a44 100644 --- a/pls.py +++ b/pls.py @@ -20,8 +20,7 @@ for i in group3: for i in sum_group_dict.keys(): f3 = lambda number: True if '1' not in number else False - if i in [13, 16]: - print(i, list(filter(f3, sum_group_dict[i]))) + print(i, -cachesum_group_dict[i]) # print(sum_group3_dict) # sum_group3 = [ sum(map(int, list(i))) for i in group3] # print(pd.value_counts(sum_group3).to_dict()) @@ -40,8 +39,7 @@ for i in sum_group6_dict.keys(): f4 = lambda number: True if max(map(int, number)) - min(map(int, number)) != 2 else False f5 = lambda number: True if '3' not in number else False f3 = lambda number: True if '8' not in number else False - if i in [13, 16]: - print(i, list(filter(f3, sum_group6_dict[i]))) + print(i, sum_group6_dict[i]) # print(pd.value_counts(sum_group3).to_dict()) # 连号