py_scripts/auto.py

38 lines
2.0 KiB
Python

import time
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="请输入手机号")
write("c113w927j", into="请输入6-12位数字或字母")
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('组选'))
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()