自己东凑西凑来的,而且是用selenium的...效率很低...因为不会requests...大佬勿喷...
作用:联通话费购每天抽奖3次。每天签到。将签到情况+近3次中奖记录推送。
PS:一般中不到好东西,最多就2块话费卷,累积着可能有用吧....办公电脑空闲...可以挂着定时跑...分享下..
[Python] 纯文本查看 复制代码 from selenium import webdriver
import datetime
from time import sleep
from selenium.webdriver.common.touch_actions import TouchActions
import json
import requests
# 网址
url = "https://atp.bol.wo.cn/atplottery/ACT202009101956022770009xRb2UQ?product=hfgo&str="
url2 = "https://account.bol.wo.cn/accountlogin?clientId=activetemplate&redirectUrl=https%3A%2F%2Fatp.bol.wo.cn%2Fatplottery%2FACT202009101956022770009xRb2UQ%3Fproduct%3Dhfgo%26str%3D"
url3 = "https://atp.bol.wo.cn/atpsign/ACT202012221038331042965g65tNa?product=hfgo%3FactId%3D517&product=hfgo&actSetId=2426&imgUrl=https%3A%2F%2Fatp.bol.wo.cn%2Fatp_resource%2Fupload%2F%2Fatp_resource%2F2020%2F09%2F27%2F7c07b0f7dc84ef08f6f939f06e309690.png&targetActId=1516"
url4 = "https://atp.bol.wo.cn/atplottery/ACT202009101956022770009xRb2UQ/winRecord?id=517&product=hfgo"
haoma = "XXXXX"# XXXX改为自己号码
mima = "XXXXX"#XXXX改为自己的密码
browser = webdriver.Chrome()# 浏览器驱动
browser.get(url2)
sleep(3)
browser.find_element_by_xpath('//*[@id="cuauth"]/div/div[3]/div[1]/input').send_keys(haoma)
browser.find_element_by_xpath('//*[@id="cuauth"]/div/div[3]/div[2]/input').send_keys(mima)
browser.find_element_by_xpath('//*[@id="cuauth"]/div/div[3]/div[4]/span').click()
browser.find_element_by_xpath('//*[@id="cuauth"]/div/div[3]/div[3]/button').click()
sleep(8)
browser.find_element_by_xpath('//*[@id="turntable"]/div[2]/div[3]/div[1]/div[1]').click()
sleep(3)
browser.find_element_by_xpath('//*[@id="turntable"]/div[2]/div[8]/div[2]/button[2]').click()
sleep(10)
browser.get(url)
sleep(5)
browser.find_element_by_xpath('//*[@id="turntable"]/div[2]/div[3]/div[1]/div[1]').click()
sleep(10)
browser.get(url)
sleep(5)
browser.find_element_by_xpath('//*[@id="turntable"]/div[2]/div[3]/div[1]/div[1]').click()
sleep(10)
browser.get(url3)
sleep(5)
browser.find_element_by_xpath('//*[@id="dailysign"]/div[2]/div[3]/div[3]').click()
sleep(3)
browser.get(url3)
sleep(5)
yue1 = browser.find_element_by_xpath('//*[@id="dailysign"]/div[2]/div[3]/div[1]').text
sleep(3)
browser.get(url4)
sleep(3)
jl1 = browser.find_element_by_xpath('//*[@id="app"]/div/div[2]/div/div/div[1]/div[2]').text
jl2 = browser.find_element_by_xpath('//*[@id="app"]/div/div[2]/div/div/div[2]/div[2]').text
jl3 = browser.find_element_by_xpath('//*[@id="app"]/div/div[2]/div/div/div[3]/div[2]').text
sleep(3)
url='http://pushplus.hxtrip.com/send'
#'token':'XXXXX'改为自己的
data={'token':'XXXXX','title':'联通话费购','content':yue1+'||'+jl1+jl2+jl3,'template':'html'}
headers={
"User-Agent":"Mozilla/5.0 (Linux; Android 9; SM-A102U) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.93 Mobile Safari/537.36",
'Content-Type': 'application/json'}
res=requests.post(headers=headers,url=url,data=json.dumps(data),timeout=10)
browser.quit()
|