fix: auto.py增加相关逻辑

This commit is contained in:
chenwj113 2022-11-01 16:05:55 +08:00
parent b9dfbbcbda
commit cac2e4b5ca
1 changed files with 76 additions and 6 deletions

82
auto.py
View File

@ -1,13 +1,12 @@
import time
from helium import * from helium import *
from selenium.webdriver import ChromeOptions from selenium.webdriver import ChromeOptions
# import time
chrome_options = ChromeOptions() chrome_options = ChromeOptions()
mobile_emulation = {'deviceName': 'iPhone XR'} mobile_emulation = {'deviceName': 'iPhone XR'}
chrome_options.add_experimental_option("mobileEmulation", mobile_emulation) 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("您尚未登录,点击登录"))
click(Text("密码登录")) click(Text("密码登录"))
write("15359827092", into="请输入手机号") write("15359827092", into="请输入手机号")
@ -16,13 +15,15 @@ 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)
# 点击排列三
#
pls = S('//*[@id="vue2_el"]/div/section/div[6]/div[4]/div[3]') 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(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")
# click(group3)
ball_0 = S('#body > section > div.betmain.betmain_p3zx > div.betmain_p3zxball > ul > li:nth-child(1) > p.ballline') 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_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_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_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_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') 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()