本文来源吾爱破解论坛
本帖最后由 larden520 于 2019-5-30 11:43 编辑
QQ截图20170723170857.jpg
(45.63 KB, 下载次数: 15)
下载附件
保存到相册
2017-7-23 17:11 上传
QQ图片20170723171100.png
(31.04 KB, 下载次数: 8)
下载附件
保存到相册
2017-7-23 17:12 上传
业余爱好喜欢琢磨数字,彩票,一时兴起,结合多年彩票算法写了个。
目前验证效果还可以。。。
可以设置 盈利预期 随机投注倍数
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):
url='http://fx.cp2y.com/xcqssc/draw_10089_history/?lid=10089&today=0'
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.*</i></td>*'
imgre1 = re.compile(reg)
b= re.findall(imgre1,sc)
# print "b",b
if len(b)!=0:
c= "".join(b).split('</i><i class="ml6 i-ball i-b20_1">') #['170624040 <b class="fw400 cred">12:41</b></span></td>\r\n\t\t\t\t<td><i class="ml6 i-ball i-b20_1">5', '3', '9', '2', '7</i></td>']
# 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
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.get('http://game.03sjc.net/')
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)
b.quit()
版权声明:
本站所有资源均为站长或网友整理自互联网或站长购买自互联网,站长无法分辨资源版权出自何处,所以不承担任何版权以及其他问题带来的法律责任,如有侵权或者其他问题请联系站长删除!站长QQ754403226 谢谢。
- 上一篇: 小白的多线程爬虫。以某漫画为例
- 下一篇: python【练手】12306查票