python写的自动投注脚本(SSC)

#coding:utf-8

import time

from selenium import webdriver

from selenium.webdriver.common.keys import Keys

import os,random,re

import urllib

import get_cphao

def get3qihao_old(now_qishu):           #取近3期的旧版本

#返回近3期组六

list3=[]

x=get_cphao.getbyqi(str(int(now_qishu)-1))

y=get_cphao.getbyqi(str(int(now_qishu)-2))

z=get_cphao.getbyqi(str(int(now_qishu)-3))

print x,y,z

for z6 in [x,y,z]:

if z6!=None:

list3.append("".join(sorted(z6)))

else:

continue

return list3

def get3qihao(now_qishu):

page = urllib.urlopen(url)

sc=page.read()

list3=[]

for a in range(int(now_qishu),int(now_qishu)-3,-1):

print str(a)+'期'

a=str(int(a)-1)

reg = str(a)+r'.*\n.**'

imgre1 = re.compile(reg)

b= re.findall(imgre1,sc)

# print "b",b

if len(b)!=0:

c= "".join(b).split('')    #['170624040 12:41\r\n\t\t\t\t

5', '3', '9', '2', '7']

# print "c",c

if len(c)!=0:

print c[2]+c[3]+c[4][0]

hao=str(c[2]+c[3]+c[4][0])

list3.append("".join(sorted(hao)))

else:

continue

print list3

return list3

def Proceed(dic):

sy=0

cb=0

# dic={u'170624072': 0.64, u'170624080': 0.64, u'170624083': 0.64, u'170624082': 0.64, u'170624085': 0.64, u'170624084': 0.64, u'170624086': 0.64}

for k,v in dic.items():

# print get_cphao.getbyqi(k)

temp=get_cphao.getbyqi(k)

if temp!=None:

# temp=get_cphao.getbyqi(k)

a= "".join(sorted(temp))

if a in haoma:

sy+=dic[k]*2.5

cb+=dic[k]

else:

cb+=dic[k]

else:

print "有NONE"

cb+=dic[k]

return (sy-cb)

znum=0

current_qihao=0

list_z3=[]  #最近3期情况

touru=0

shouyi=0

beishu=0

cp_data={}   #期号投入情况,便于计算收益

def firstcp():

file1=open(r'D:/Downloads/cp_log.txt','a+')

time.sleep(5)

try:

now_qishu=b.find_element_by_xpath('//*[@id="current_issue"]').text

except:

time.sleep(10)

print u"停顿10秒后找当期号!"

b.find_element_by_xpath('//*[@id="tabbar-div-s2"]/span[3]/span[2]').click()

now_qishu=b.find_element_by_xpath('//*[@id="current_issue"]').text

print "find it"

print u"当前期数:%s"%now_qishu

# get3qihao(now_qishu)       这里会输出一次

global znum

global current_qihao  #用作外部判断用

global list_z3

global touru

global shouyi

current_qihao=now_qishu

zhongjiangcishu=0

global beishu

for hm in get3qihao(now_qishu):

if hm in haoma:

zhongjiangcishu+=1            #最近3期的中奖次数

znum+=1

print u"全计划已中:%s次"%znum

print "最近3期中 %s次"%zhongjiangcishu

list_z3.append(zhongjiangcishu)

beishu='5'

if len(list_z3)>=5 and (list_z3[-5:].count(0)==5):   #列表里至少有4个记录,并且最近3记录都是0情况

beishu=random.randint(8,15)

print beishu

b.find_element_by_xpath('//*[@id="tabbar-div-s2"]/span[3]/span[2]').click()   #后三

time.sleep(2)

b.find_element_by_xpath('//*[@id="smalllabel_1_3"]').click()

time.sleep(2)

print "test"

if zhongjiangcishu<=0:

b.find_element_by_xpath('//*[@id="lt_write_box"]').send_keys(haoma)

b.find_element_by_xpath('//*[@id="choosemodes"]/span[4]').click()    #厘模式

b.find_element_by_xpath('//*[@id="lt_sel_dyprize"]/option[2]').click()   #超级返奖

b.find_element_by_xpath('//*[@id="lt_sel_times"]').clear()

b.find_element_by_xpath('//*[@id="lt_sel_times"]').send_keys(str(beishu))  #倍模式

touru=int(beishu)*0.128

cp_data[current_qihao]=touru

time.sleep(1)

b.find_element_by_xpath('//*[@id="lt_sel_insert"]').click()   #添加

time.sleep(2)

b.find_element_by_xpath('//*[@id="lt_buy"]').click()

time.sleep(3)

b.find_element_by_xpath('//*[@id="confirm_yes"]').click()

file1.write("%s 期投注:"%str(current_qihao) +' ')

file1.write("%s 倍数"%str(beishu)+'\n')

try:

b.find_element_by_xpath('//*[@id="alert_close_button"]').click()

except:

print "close"

file1.close()

test_randome=random.randint(1,9)

if (zhongjiangcishu==1) and (test_randome>=5):               #对近3期中1加入50%随机

b.find_element_by_xpath('//*[@id="lt_write_box"]').send_keys(haoma)

b.find_element_by_xpath('//*[@id="choosemodes"]/span[4]').click()    #厘模式

b.find_element_by_xpath('//*[@id="lt_sel_dyprize"]/option[2]').click()   #超级返奖

b.find_element_by_xpath('//*[@id="lt_sel_times"]').clear()

b.find_element_by_xpath('//*[@id="lt_sel_times"]').send_keys('4')  #倍模式

touru=int(beishu)*0.128

cp_data[current_qihao]=touru

time.sleep(1)

b.find_element_by_xpath('//*[@id="lt_sel_insert"]').click()   #添加

time.sleep(2)

b.find_element_by_xpath('//*[@id="lt_buy"]').click()

time.sleep(3)

b.find_element_by_xpath('//*[@id="confirm_yes"]').click()

file1.write("%s 期投注:"%str(current_qihao) +' ')

file1.write("5:倍数 近3期==1 "+'\n')

try:

b.find_element_by_xpath('//*[@id="alert_close_button"]').click()

except:

print "close"

file1.close()

else:

print "本轮放弃,不投注",current_qihao

b=webdriver.Chrome()

b.set_window_position(-500,0)

b.implicitly_wait(30)

b.maximize_window()

b.find_element_by_xpath('//*[@id="username"]').send_keys('username')

time.sleep(30)

print "ha ha ha where's the money ?"

print "****************************************"

print "begin the game! show me the money !"

print b.title

time.sleep(3)

num=0

haoma='013,014,016,017,019,023,025,026,028,' \

'029,034,035,036,037,038,039,046,047,049,' \

'056,058,059,067,068,069,079,089,134,136,137,139,' \

'146,149,167,169,179,235,236,238,239,256,259,268,' \

'269,289,346,347,349,356,358,359,367,368,369,379,' \

b.switch_to_frame('leftframe')

print b.find_element_by_xpath('//*[@id="usermoney"]').text

b.find_element_by_xpath('//*[@id="leftcon"]/div[3]/div/a[1]').click()   #重庆

time.sleep(4)

b.switch_to.default_content()   #google

# b._switch_to.parent_frame()      #ie

time.sleep(0.5)

b.switch_to_frame('mainframe')

print "      ready go!!!      "

b.find_element_by_xpath('//*[@id="tabbar-div-s2"]/span[3]/span[2]').click()   #后三

b.find_element_by_xpath('//*[@id="lt_sel_dyprize"]/option[2]').click()

for i in range(100):

print "这是第 %s 次 运行:"%num

last_id=current_qihao

print "lastid :",last_id

# firstcp()

print u"前倍数:",beishu

try:

firstcp()

except Exception as msg:

print msg

print u"后倍数:",beishu

print cp_data

count=0

ctime=100

ncount=ctime-count

print "current:",current_qihao

# print int(current_qihao)-int(last_id)

while(int(current_qihao)<=int(last_id)):

# ncount=ctime-count

print "||---"+"倒计时"+"----|| " ,ncount

time.sleep(10)            #10秒后再检测期数

ncount=ncount-1

if ncount<50:

b.refresh()

time.sleep(30)

b.switch_to_frame('leftframe')

b.find_element_by_xpath('//*[@id="leftcon"]/div[3]/div/a[1]').click()

b.switch_to.default_content()

time.sleep(0.5)

b.switch_to_frame('mainframe')

try:

current_qihao=b.find_element_by_xpath('//*[@id="current_issue"]').text

print "******current:",current_qihao

except:

print "获取开奖期号失败..."

b.refresh()

print "已刷新"

time.sleep(5)

b.switch_to_frame('leftframe')

b.find_element_by_xpath('//*[@id="leftcon"]/div[3]/div/a[1]').click()

b.switch_to.default_content()

time.sleep(0.5)

b.switch_to_frame('mainframe')

b.find_element_by_xpath('//*[@id="tabbar-div-s2"]/span[3]/span[2]').click()

time.sleep(5)

current_qihao=b.find_element_by_xpath('//*[@id="current_issue"]').text

print  "上期投注时间结束,等待开奖,正在销售 %s 期:"%str(current_qihao)

time.sleep(180)

num+=1

if znum>=100:

print "over"

exit(0)

print "num=**************************************** ",num

if num%5==0:

file2=open(r'D:/Downloads/cp_log.txt','a+')

print "cp_data:-----:",cp_data

if cp_data!=None:

value=Proceed(cp_data)

print "*******当前收益*********:",value

file2.write("*******当前收益********* %s:"%value+'\n')

file2.close()

if value>=10.0:

print "收益达到预期,结束"

exit(0)

python自动投注软件_能帮我开发一个自动投注的脚本吗?相关推荐

  1. python怎么打印网页_教你分分钟开发一个属于自己的python模块(一)——能够直接在浏览器打印的方法...

    曾经,用惯了python print命令的人,惊叹于python语法的精简:后来,用过了tornado.django等web开发框架,不得不佩服当初开发这些框架的人们.于是,我们开始使用它们的框架== ...

  2. python写签到软件_第一个实用python程序——自动填写工作日志、签到

    刚刚把文章重看了一遍,自己给的评价就是:闲的没事干了? 1. 前言 一直苦于每天要分上下午两次写工作日志(不太能理解单位某些部门的脑洞--一天一次不行么?噢--噢噢,好吧,你们抄的模板就是分上下午的, ...

  3. python制作电脑软件_利用PYTHON制作桌面版爬虫软件(一)

    抱歉,对长沙房地产数据的挖掘与分析[三],想了蛮久,觉得对自己的分析结果不是很理想.等我完善好了,我再发出来吧.今天继续开启新的一专题.主要讲解如何用PYTHON实现简单的桌面软件的制作. 题外话,我 ...

  4. python炒股学习软件_【免费赠书】什么?学Python还能用来炒股!

    "我天天研究股票,为了股票,连女票都分手了,为什么还是亏了个底朝天?" 朋友大雄向我诉苦,这小子沉迷炒股两三年,自称股神,最近却接连亏光了毕业以来的全部工资,连准备爹妈给的结婚本钱 ...

  5. python 表格处理软件_基于Python的Excel处理工具

    1项目描述# #的辛勤工作,以减少处理Excel在我姐姐的工作中,我写了一些代码处理xlsx在python中独立完成一些任务,如判断未来的列表,晚了,每天和早期离开根据考勤记录,并实现两个细胞的比较复 ...

  6. python电子相册制作软件_电子相册怎么做

    电子相册制作 本文来自#千兆网络有什么用#征稿活动,不断提速的网络给你的生活带来了什么变化?快来参与活动,聊聊你玩转互联网,高速网上冲浪的经历!>点击这里查看活动详情< 现在手机的拍照功能 ...

  7. python实现数据恢复软件_恢复python

    centos 7 python2.7.5升级到3.5.2 centos 7 python2.7.5升级到3.5.2 下载python3.5.2 wget https://www.python.org/ ...

  8. 免费学python的手机软件_别再说你在学Python,连软件都没“安全”

    选择要安装的版本点击下载,下载完成后按要求安装.安装成功后打开cmd输入Python,如果出现以下提示,证明安装成功. 记得要添加变量环境.如果忘记勾选可以点击[计算机]右键选择[属性] 选择[高级系 ...

  9. python 爬取软件_用Python爬取了三大相亲软件评论区,结果...

    小三:怎么了小二?一副愁眉苦脸的样子. 小二:唉!这不是快过年了吗,家里又催相亲了 ... 小三:现在不是流行网恋吗,你可以试试相亲软件呀. 小二:这玩意靠谱吗? 小三:我也没用过,你自己看看软件评论 ...

最新文章

  1. WPF 提供了以下关键帧动画类[msdn]
  2. C#反编译工具Reflector使用方法
  3. 秒懂5G!通俗易懂外行也能看明白
  4. springmvc最简单的搭建,初学者必看
  5. 异常:System.BadImageFormatException,未能加载正确的程序集XXX
  6. php表格合并_如何在php生成的表中合并单元格?
  7. Exadata Griddisk Can't be auto added
  8. ORACLE报错:enviroment variable ORACLE_SID not defined,please define int
  9. 设备驱动简介 -- ldd3读书笔记
  10. CMOS密码清除方法
  11. Android自动挂断电话
  12. 不同产品类型、不同应用、产能、产量、销量、需求量及销售收入-外置固态硬盘
  13. 一般论文发表流程有哪些
  14. (转载)一套键鼠控制多台电脑操作——Synergy软件(windows环境)
  15. JavaScript中事件的绑定与解绑
  16. Bill Gekas儿童摄影作品欣赏
  17. 人大金仓windows 10 安装闪退,改绿色安装方法,
  18. 哈希表解决冲突的两种方式
  19. 数组数据结构的使用与代码编写(一)
  20. Oracle 报错 28000原因和解决方法

热门文章

  1. 一维FDTD电磁波仿真
  2. win11、10下安装eNSP最新系列(1.3.00)并完美运行
  3. 电商行业安全解决方案
  4. Advertising on YouTube 如何在YouTube发布广告 Lynda课程中文字幕
  5. awk中字符串处理函数
  6. 使用selenuim模拟动态登录百度
  7. Linux系统管理员应该了解的一些I/O统计工具
  8. 第二篇--PCI设备解析
  9. 如何锁定MATLAB 图片大小,哪位亲知道怎么把图片做成固定大小啊比如200*230什么的这种? 爱问知识人...
  10. 西门子PLC1500大型fanuc机器人焊装 包括1台西门子1500PLC程序,2台触摸屏TP1500程序