Exemplo n.º 1
0
import sys

sys.path.append('../')

from jra import parser_top as pr
from jra import parser_odds_top as prot
from jra import parser_odds_kaisai as prok

parser_top = pr.parser_top()
param_list = parser_top.parse()

if 'odds' in param_list == False:
    print("No odd param")
    sys.exit()

parser_odds_top = prot.parser_odds_top('/JRADB/accessO.html',
                                       param_list['odds'])
kaisai_list = parser_odds_top.parse()

param_list_x = []
param_list_x.append(param_list['odds'])
for kaisai in kaisai_list:
    kaisai_place_list = kaisai['kaisai_list']
    for kaisai_place in kaisai_place_list:
        parser_odds_kaisai = prok.parser_odds_kaisai('/JRADB/accessO.html',
                                                     kaisai_place['param'])
        param_list_x.append(kaisai_place['param'])
        race_list = parser_odds_kaisai.parse()
        for race in race_list:
            if 'win' in race:
                param_list_x.append(race['win'])
            if 'waku' in race:
Exemplo n.º 2
0
import sys

sys.path.append('../')

from jra import parser_top as pr
from jra import parser_odds_top as prot
from jra import parser_odds_kaisai as prok
from jra import parser_odds_win as prow

use_network = True

_parser = prot.parser_odds_top('/JRADB/accessO.html', 'pw15oli00/6D')

if use_network:
    kaisai_list = _parser.parse()
else:
    args = sys.argv

    if len(args) < 2:
        print("Specify Test File Name")
        sys.exit()

    with open(args[1], 'rb') as rfp:
        response_body = rfp.read().decode("'shift_jis'")
        kaisai_list = _parser.parse_html(response_body)

for date in kaisai_list:
    print("日付: {}".format(date['date']))
    for kaisai in date['kaisai_list']:
        print(" 開催 : {}".format(kaisai['kaisai']))
        print(" Param : {}".format(kaisai['param']))