Last active
August 29, 2015 14:19
-
-
Save codervince/c2765b338106c618ddb3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
HKResults project | |
Phase 2 | |
PRELIMINARIES: | |
take hkjc_spider.py from andrey-chabrov/racingpost | |
new repo https://github.com/codervince/hkjcresults.git | |
Add following fields, e.g. | |
http://racing.hkjc.com/racing/Info/Meeting/Results/English/Local/20150524/ST/11 | |
parse_race | |
RaceClass e.g. 1 (int) | |
RaceDistance e.g. 1600 (remove m - int) | |
RaceGoing e.g. YIELDING | |
RaceTrack e.g. TURF - "C+3" COURSE | |
HorseCodeList e.g. ['N159', 'S206', 'S253', 'S352',..] | |
RacingIncidentReport '' (text) | |
parse_sectional_time | |
string unless stated otherwise: | |
results page (http://racing.hkjc.com/racing/Info/Meeting/Results/English/Local/20150524/ST/10) | |
item[..] | |
JockeyName e.g. M.L Yeung | |
JockeyCode e.g. YML | |
TrainerName e.g. C Fownes | |
TrainerCode e.g. FC | |
ActualWt e.g. 123 (int) | |
DeclarHorseWt e.g. 1086 | |
Jockey2HorseWt ActualWt/DeclarHorseWt (float) | |
Draw | |
LBW | |
RunningPosition | |
FinishTime (time) 1.11.20 | |
WinOdds float | |
**OPTIONAL** | |
WinOddsRank e.g. 8 (lowest = rank 1) | |
sectionals page | |
http://www.hkjc.com/english/racing/display_sectionaltime.asp?racedate=24/05/2015&Raceno=10&All=0 | |
MarginsBehindLeader e.g. [ '3-1/4', '2-3/4', 'SH', None, None, None] (horse 1) | |
parse_horse | |
OwnerName e.g. 'Mr & Mrs Andrew Wong Kwok Kin' | |
Dam e.g. Trephina | |
DamsSire e.g. Last Tycoon | |
********************************************************************* | |
Phase 1 - COMPLETE! | |
Input: | |
params | |
racedate YYYYMMDD | |
racecoursecode 'ST' or 'HV' | |
Start at racenumber =1 | |
http://racing.hkjc.com/racing/Info/Meeting/Results/English/Local/20150412/ST/1 | |
FOR EACH RACE NUMBER | |
(/racing/Info/Meeting/Results/English/Local/20150412/ST/RaceNumber) | |
Get | |
RaceNumber e.g. 2 | |
RaceIndex e.g. 525 | |
RaceName e. DENGSHIKOU HANDICAP | |
Table class tableBorder trBgBlue tdAlignC number12 draggable | |
HorseNumber e.g. 1 | |
HorseName e.g. BERNARD'S CHOICE | |
HorseCode e.g. N156 | |
parse_sectionals | |
http://www.hkjc.com/english/racing/display_sectionaltime.asp?RaceDate=12/04/2015&Raceno=2&All=0#Race2 | |
FirstSec e.g. 24.53 | |
SecondSec e.g. 22.16 | |
SixthSec e.g.None | |
parse_horse | |
e.g. | |
(important #htop to get all races) | |
http://www.hkjc.com/english/racing/horse.asp?HorseNo=N156&Option=1#htop | |
SireName e.g. Sebring | |
L1RaceDate e.g.29/03/15 | |
L1Place e.g. 02 | |
for last 5 races e.g. L{i}RaceDate. L{i}Place | |
return item per horse as before to CSV | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment