1999-200python代码 (需要安装Jupyter和chromedriver)

原创 赚Q币手赚项目  2020-07-18 11:41 

【推荐】:任务赚钱app:悬赏猫(补充:刷Q币是假的,Q币绝对刷不了!

悬赏猫,可以通过任务赚钱,秒提微信红包。用户可点击链接注册下载悬赏猫

http://www.nnzhuan.com/s/xuanshangmao.html

电脑用户用手机扫码注册下载悬赏猫

小编悬赏猫的收款图:


手机任务赚钱app趣闲赚

用户可点击链接注册下载

http://www.nnzhuan.com/s/quxianzhuan.html

看到吧里有人分享python抢购代码,我分享一下我写的,互相学习
# coding = utf-8
import time
import requests
from selenium import webdriver
from datetime import datetime

# 预定的时间
start_time = '2020-07-17 23:59:59'
timeArray = datetime.strptime(start_time, "%Y-%m-%d %H:%M:%S")
def time_server():
#获得京东服务器时间
r1 = requests.get(url='https://a.jd.com//ajax/queryServerData.html',
headers={
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/6.2.4098.3 Safari/537.36'}
).json()['serverTime']
# 获取本地服务器的时间戳
#r1 = time.time()*1000#获当前时间的时间戳
# 把时间戳格式/1000 获取毫秒
timeNum = int(r1) / 1000
# 格式化时间 (小数点后6为)
time1 = datetime.fromtimestamp(timeNum)
return time1
# 等待时间到预定的时间
print("等待中")

def refresh(url,num):
#填写chromedriver路径
driver = webdriver.Chrome("C:\Program Files (x86)\g/oo/gle\Chrome\Application\chromedriver.exe")
driver.get("https://plogin.m.jd.com/login/login?appid=300&returnurl=https%3A%2F%2Fwqlogin1.jd.com%2Fpassport%2FLoginRedirect%3Fstate%3D1257799874%26returnurl%3D%252F%252Fhome.m.jd.com%252FmyJd%252Fnewhome.action%253Fsceneval%253D2%2526ufc%253D%2526&source=wq_passport")
while True:
# 判断时间服务器时间是否大于或等于开始的时间
if time_server() >=timeArray:
time.sleep(0.9)
driver.get(url)
print(time_server())
#print(datetime.now())
print("任务开始")
for i in range(num):
time.sleep(0.1)
driver.refresh()
print(time_server())
#print(datetime.now())
print("任务完成")
driver.close()
break

if __name__ == "__main__":
url = input("Please enter the url:\n")
num = 100
refresh(url,num)
复制代码

本文地址:http://huanqutang.com/30312.html
关注我们:请关注一下我们的微信公众号:扫描二维码免费刷Q币,赚Q币的公众号,公众号:heimaoseoer
版权声明:本文为原创文章,版权归 赚Q币手赚项目 所有,欢迎分享本文,转载请保留出处!

评论已关闭!