From b9dfbbcbda2bf968d864a31e2fd2220928cd079a Mon Sep 17 00:00:00 2001 From: chenwj113 Date: Tue, 1 Nov 2022 15:14:04 +0800 Subject: [PATCH 1/4] =?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()) # 连号 From cac2e4b5caddf2832489a54b1f6f8316ba3f0f07 Mon Sep 17 00:00:00 2001 From: chenwj113 Date: Tue, 1 Nov 2022 16:05:55 +0800 Subject: [PATCH 2/4] =?UTF-8?q?fix:=20auto.py=E5=A2=9E=E5=8A=A0=E7=9B=B8?= =?UTF-8?q?=E5=85=B3=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- auto.py | 82 ++++++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 76 insertions(+), 6 deletions(-) diff --git a/auto.py b/auto.py index 54c4cd8..206e072 100644 --- a/auto.py +++ b/auto.py @@ -1,13 +1,12 @@ -import time - from helium import * from selenium.webdriver import ChromeOptions +# import time 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) +driver = start_chrome("https://youdian.jindianle.com/", options=chrome_options) click(Text("您尚未登录,点击登录")) click(Text("密码登录")) write("15359827092", into="请输入手机号") @@ -16,13 +15,15 @@ click(Button("登 录")) # 进入页面先点击关闭弹窗按钮 _close = S('//*[@id="vue2_el"]/div/div[10]/div/p') click(_close) - -# +# 点击排列三 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('组选')) +# 普通投注-> 取消组3 +# group3 = S('#body > section > div.betmain.betmain_p3zx > div.betmain_p3zxmenu.topcenter > p:nth-child(1)') +group3 = Text("组3") +# click(group3) 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') @@ -33,6 +34,75 @@ ball_6 = S('#body > section > div.betmain.betmain_p3zx > div.betmain_p3zxball > 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') +# click(ball_1) +# click(ball_2) +# click(ball_3) +# 和值投注 +click(Text("和值投注")) +sum_1 = Text("1") +sum_2 = Text("2") +sum_3 = Text("3") +sum_4 = Text("4") +sum_5 = Text("5") +sum_6 = Text("6") +sum_7 = Text("7") +sum_8 = Text("8") +sum_9 = Text("9") +sum_10 = Text("10") +sum_11 = Text("11") +sum_12 = Text("12") +sum_13 = Text("13") +sum_14 = Text("14") +sum_15 = Text("15") +sum_16 = Text("16") +sum_17 = Text("17") +sum_18 = Text("18") +sum_19 = Text("19") +sum_20 = Text("20") +sum_21 = Text("21") +sum_22 = Text("22") +sum_23 = Text("23") +sum_24 = Text("24") +sum_25 = Text("25") +sum_26 = Text("26") +click(sum_9) + +# click(Text("组3单式")) +# 对子号码 +double_ball_0 = S('#body > section > div.betmain.betmain_p3zxd > div:nth-child(1) > div.boxflex > ul > li:nth-child(1) > p') +double_ball_1 = S('#body > section > div.betmain.betmain_p3zxd > div:nth-child(1) > div.boxflex > ul > li:nth-child(2) > p') +double_ball_2 = S('#body > section > div.betmain.betmain_p3zxd > div:nth-child(1) > div.boxflex > ul > li:nth-child(3) > p') +double_ball_3 = S('#body > section > div.betmain.betmain_p3zxd > div:nth-child(1) > div.boxflex > ul > li:nth-child(4) > p') +double_ball_4 = S('#body > section > div.betmain.betmain_p3zxd > div:nth-child(1) > div.boxflex > ul > li:nth-child(5) > p') +double_ball_5 = S('#body > section > div.betmain.betmain_p3zxd > div:nth-child(1) > div.boxflex > ul > li:nth-child(6) > p') +double_ball_6 = S('#body > section > div.betmain.betmain_p3zxd > div:nth-child(1) > div.boxflex > ul > li:nth-child(7) > p') +double_ball_7 = S('#body > section > div.betmain.betmain_p3zxd > div:nth-child(1) > div.boxflex > ul > li:nth-child(8) > p') +double_ball_8 = S('#body > section > div.betmain.betmain_p3zxd > div:nth-child(1) > div.boxflex > ul > li:nth-child(9) > p') +double_ball_9 = S('#body > section > div.betmain.betmain_p3zxd > div:nth-child(1) > div.boxflex > ul > li:nth-child(10) > p') +# 非对子号码 +single_ball_0 = S('#body > section > div.betmain.betmain_p3zxd > div:nth-child(2) > div.boxflex > ul > li:nth-child(1) > p') +single_ball_1 = S('#body > section > div.betmain.betmain_p3zxd > div:nth-child(2) > div.boxflex > ul > li:nth-child(2) > p') +single_ball_2 = S('#body > section > div.betmain.betmain_p3zxd > div:nth-child(2) > div.boxflex > ul > li:nth-child(3) > p') +single_ball_3 = S('#body > section > div.betmain.betmain_p3zxd > div:nth-child(2) > div.boxflex > ul > li:nth-child(4) > p') +single_ball_4 = S('#body > section > div.betmain.betmain_p3zxd > div:nth-child(2) > div.boxflex > ul > li:nth-child(5) > p') +single_ball_5 = S('#body > section > div.betmain.betmain_p3zxd > div:nth-child(2) > div.boxflex > ul > li:nth-child(6) > p') +single_ball_6 = S('#body > section > div.betmain.betmain_p3zxd > div:nth-child(2) > div.boxflex > ul > li:nth-child(7) > p') +single_ball_7 = S('#body > section > div.betmain.betmain_p3zxd > div:nth-child(2) > div.boxflex > ul > li:nth-child(8) > p') +single_ball_8 = S('#body > section > div.betmain.betmain_p3zxd > div:nth-child(2) > div.boxflex > ul > li:nth-child(9) > p') +single_ball_9 = S('#body > section > div.betmain.betmain_p3zxd > div:nth-child(2) > div.boxflex > ul > li:nth-child(10) > p') + +# 点击一次下一步 +next_step = Text("下一步") +click(next_step) + +# 设置倍数后,再点击一次下一步 +plus = Text("+") +click(plus) +click(Text("下一步")) + +# 最后一步, 点击确认 +confirm = Text("确认") +# click(confirm) # time.sleep(5) # kill_browser() \ No newline at end of file From c4562f203aecffba683700c5dc3d2df49cdafa19 Mon Sep 17 00:00:00 2001 From: chenwj <654891551@qq.com> Date: Thu, 10 Nov 2022 16:39:08 +0800 Subject: [PATCH 3/4] =?UTF-8?q?fix:=20auto.py=E5=A2=9E=E5=8A=A0wait=5Funti?= =?UTF-8?q?l=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- auto.py | 35 ++++++++++++++++++++++++++--------- 1 file changed, 26 insertions(+), 9 deletions(-) diff --git a/auto.py b/auto.py index 206e072..dc56d7b 100644 --- a/auto.py +++ b/auto.py @@ -1,12 +1,12 @@ from helium import * from selenium.webdriver import ChromeOptions -# import time +import time chrome_options = ChromeOptions() mobile_emulation = {'deviceName': 'iPhone XR'} chrome_options.add_experimental_option("mobileEmulation", mobile_emulation) -driver = start_chrome("https://youdian.jindianle.com/", options=chrome_options) +start_chrome("https://youdian.jindianle.com/", options=chrome_options) click(Text("您尚未登录,点击登录")) click(Text("密码登录")) write("15359827092", into="请输入手机号") @@ -15,14 +15,31 @@ click(Button("登 录")) # 进入页面先点击关闭弹窗按钮 _close = S('//*[@id="vue2_el"]/div/div[10]/div/p') click(_close) + +#店内账本 +click(Text("店内账本")) +# vue2_el > div:nth-child(2) > section > div > div > div.pad30px.mb15.border_b.bgfff.balance_top > div:nth-child(2) > span.gray3.moneynum +# moneynum = S('//*[@id="vue2_el"]/div[1]/section/div/div/div[3]/div[2]/span[1]') +moneynum = S('//span[contains(@class, "gray3") and contains(@class, "moneynum")]') +wait_until(moneynum.exists) +if moneynum is not None: + balance = moneynum.web_element.text + print(f"金额还剩:{balance}") +else: + print("元素未找到") +# 回退 +back = S('#vue2_el > header > div.back > a') +click(back) + # 点击排列三 pls = S('//*[@id="vue2_el"]/div/section/div[6]/div[4]/div[3]') click(pls) -click(Text('组选')) +# click(Text('组选')) + # 普通投注-> 取消组3 # group3 = S('#body > section > div.betmain.betmain_p3zx > div.betmain_p3zxmenu.topcenter > p:nth-child(1)') -group3 = Text("组3") +# group3 = Text("组3") # click(group3) 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') @@ -39,7 +56,7 @@ ball_9 = S('#body > section > div.betmain.betmain_p3zx > div.betmain_p3zxball > # click(ball_3) # 和值投注 -click(Text("和值投注")) +# click(Text("和值投注")) sum_1 = Text("1") sum_2 = Text("2") sum_3 = Text("3") @@ -66,7 +83,7 @@ sum_23 = Text("23") sum_24 = Text("24") sum_25 = Text("25") sum_26 = Text("26") -click(sum_9) +# click(sum_9) # click(Text("组3单式")) # 对子号码 @@ -94,12 +111,12 @@ single_ball_9 = S('#body > section > div.betmain.betmain_p3zxd > div:nth-child(2 # 点击一次下一步 next_step = Text("下一步") -click(next_step) +# click(next_step) # 设置倍数后,再点击一次下一步 plus = Text("+") -click(plus) -click(Text("下一步")) +# click(plus) +# click(Text("下一步")) # 最后一步, 点击确认 confirm = Text("确认") From 5e38fc6df71d1a313a2d5eab1bd278355dd6ba97 Mon Sep 17 00:00:00 2001 From: chenwj <654891551@qq.com> Date: Thu, 10 Nov 2022 16:40:55 +0800 Subject: [PATCH 4/4] =?UTF-8?q?bugfix:=20=E4=BF=AE=E5=A4=8D=E5=BC=82?= =?UTF-8?q?=E5=B8=B8=E4=BF=A1=E6=81=AF=E8=BE=93=E5=87=BA=E5=8F=98=E9=87=8F?= =?UTF-8?q?=E5=91=BD=E5=90=8D=E6=9C=89=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lottery.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lottery.py b/lottery.py index 4256d49..1b5f125 100644 --- a/lottery.py +++ b/lottery.py @@ -47,7 +47,7 @@ class Lottery(object): else: record.draw_date = date(int(m2.group(1)), int(m2.group(2)), int(m2.group(3))) else: - raise Exception(f"issue:{issue}数据写入失败。。。") + raise Exception(f"issue:{draw_issue}数据写入失败。。。") # 如果是排列3和3D if isinstance(record, PLS) or isinstance(record, SD): record.hundred = draw_code[0]