学习python联系常识:参考尚学堂姿色案例学习通过python获得双色球彩票信息。
皇冠客服飞机:@seo3687网站(http://datachart.500.com/ssq/)页面信息如下:
注:需要使用到 etree包,提前进行安设
import requests from lxml import etree url= 'http://datachart.500.com/ssq' headers={'User-Agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36'} res = requests.get(url,headers=headers) res.encoding='gbk' e = etree.HTML(res.text) red_balls=[reds.xpath('./td[contains(@class,"chartBall01")]/text()' ) for reds in e.xpath('//tbody[@id="tdata"]/tr[not(contains(@class,"tdbck"))]')] blue_balls=e.xpath('//tbody[@id="tdata"]/tr[not(contains(@class,"tdbck"))]/td[contains(@class,"chartBall02")]/text()') dts=e.xpath('//tbody[@id="tdata"]/tr[not(contains(@class,"tdbck"))]/td[contains(@align,"center")]/text()') for dt,r,b in zip(dts,red_balls,blue_balls): print(f'{dt}期开奖号码:红球是{r} 蓝球是 {b}')
初始遵守如下:
22106 期开奖号码:红球是['17', '20', '22', '23', '24', '31'] 蓝球是 1 22107 期开奖号码:红球是['3', '9', '11', '15', '19', '28'] 蓝球是 16 22108 期开奖号码:红球是['1', '7', '13', '17', '18', '31'] 蓝球是 15 22109 期开奖号码:红球是['4', '11', '13', '19', '22', '33'] 蓝球是 11 22110 期开奖号码:红球是['9', '13', '15', '18', '20', '28'] 蓝球是 15 22111 期开奖号码:红球是['2', '10', '11', '13', '28', '31'] 蓝球是 1 22112 期开奖号码:红球是['3', '5', '8', '17', '25', '31'] 蓝球是 1 22113 期开奖号码:红球是['13', '14', '20', '24', '27', '29'] 蓝球是 2 22114 期开奖号码:红球是['1', '5', '15', '19', '26', '29'] 蓝球是 13 22115 期开奖号码:红球是['6', '7', '18', '20', '27', '29'] 蓝球是 9 22116 期开奖号码:红球是['8', '14', '26', '27', '30', '33'] 蓝球是 1 22117 期开奖号码:红球是['4', '13', '17', '18', '28', '29'] 蓝球是 6 22118 期开奖号码:红球是['2', '6', '7', '11', '14', '33'] 蓝球是 8 22119 期开奖号码:红球是['2', '5', '15', '18', '26', '27'] 蓝球是 4 22120 期开奖号码:红球是['2', '15', '19', '26', '27', '29'] 蓝球是 2 22121 期开奖号码:红球是['12', '17', '22', '27', '30', '31'] 蓝球是 2 22122 期开奖号码:红球是['6', '8', '17', '19', '24', '28'] 蓝球是 5 22123 期开奖号码:红球是['10', '13', '16', '20', '21', '25'] 蓝球是 5 22124 期开奖号码:红球是['5', '10', '13', '18', '24', '26'] 蓝球是 1 22125 期开奖号码:红球是['2', '3', '7', '12', '20', '31'] 蓝球是 16 22126 期开奖号码:红球是['1', '13', '15', '17', '26', '33'] 蓝球是 13 22127 期开奖号码:红球是['3', '4', '9', '10', '29', '33'] 蓝球是 13 22128 期开奖号码:红球是['3', '12', '18', '24', '27', '29'] 蓝球是 1 22129 期开奖号码:红球是['10', '12', '14', '22', '24', '27'] 蓝球是 7 22130 期开奖号码:红球是['2', '8', '15', '17', '26', '28'] 蓝球是 12 22131 期开奖号码:红球是['3', '5', '10', '13', '19', '29'] 蓝球是 6 22132 期开奖号码:红球是['1', '3', '18', '26', '32', '33'] 蓝球是 4 22133 期开奖号码:红球是['5', '8', '16', '17', '21', '25'] 蓝球是 12 22134 期开奖号码:红球是['1', '5', '14', '17', '24', '31'] 蓝球是 14 22135 期开奖号码:红球是['9', '11', '13', '24', '28', '32'] 蓝球是 6
后续再将数据写入数据库,模拟选号等。
皇冠体育注: 本代码仅供学习参考,皇冠信用盘3登录谢却用作罪人或阻拦性操作,不然皇冠博彩app下载,拖累风光哦。