fix: auto.py增加手机模式

This commit is contained in:
chenwj113 2022-11-01 15:14:04 +08:00
parent 07e24ca5a7
commit a06e60abb5
2 changed files with 98 additions and 12 deletions

104
auto.py
View File

@ -1,7 +1,12 @@
from helium import * from helium import *
import time from selenium.webdriver import ChromeOptions
# import time
driver = start_chrome("https://youdian.jindianle.com/", headless=True) 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)
click(Text("您尚未登录,点击登录")) click(Text("您尚未登录,点击登录"))
click(Text("密码登录")) click(Text("密码登录"))
write("15359827092", into="请输入手机号") write("15359827092", into="请输入手机号")
@ -10,11 +15,94 @@ click(Button("登 录"))
# 进入页面先点击关闭弹窗按钮 # 进入页面先点击关闭弹窗按钮
_close = S('//*[@id="vue2_el"]/div/div[10]/div/p') _close = S('//*[@id="vue2_el"]/div/div[10]/div/p')
click(_close) click(_close)
# 点击竞彩足球 # 点击排列三
jczq = S('//*[@id="vue2_el"]/div/section/div[6]/div[2]/div[1]/a/p/em') pls = S('//*[@id="vue2_el"]/div/section/div[6]/div[4]/div[3]')
click(jczq) click(pls)
fenxi_list = find_all(Text("分析")) click(Text('组选'))
print(fenxi_list)
# click(fenxi_list[0]) # 普通投注-> 取消组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')
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')
# 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) # time.sleep(5)
# kill_browser() # kill_browser()

6
pls.py
View File

@ -20,8 +20,7 @@ for i in group3:
for i in sum_group_dict.keys(): for i in sum_group_dict.keys():
f3 = lambda number: True if '1' not in number else False f3 = lambda number: True if '1' not in number else False
if i in [13, 16]: print(i, -cachesum_group_dict[i])
print(i, list(filter(f3, sum_group_dict[i])))
# print(sum_group3_dict) # print(sum_group3_dict)
# sum_group3 = [ sum(map(int, list(i))) for i in group3] # sum_group3 = [ sum(map(int, list(i))) for i in group3]
# print(pd.value_counts(sum_group3).to_dict()) # 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 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 f5 = lambda number: True if '3' not in number else False
f3 = lambda number: True if '8' not in number else False f3 = lambda number: True if '8' not in number else False
if i in [13, 16]: print(i, sum_group6_dict[i])
print(i, list(filter(f3, sum_group6_dict[i])))
# print(pd.value_counts(sum_group3).to_dict()) # print(pd.value_counts(sum_group3).to_dict())
# 连号 # 连号