Created
June 21, 2021 17:44
-
-
Save moccos/1fa6ee655b7ad14260da9748044d5737 to your computer and use it in GitHub Desktop.
ttps://www.tokyo-tc.com/h_list_kouma.html からとる
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
#!perl | |
# 読み飛ばす | |
while (<>) { | |
last if /<div class="horseList">/; | |
} | |
# テーブルをばらす | |
while (<>) { | |
if (/<h4 class="name">/) { | |
s/<.+?>//g; | |
s/\s//g; | |
$name = $_; | |
} elsif (m|<p class="seiseki">年齢:1 性別:(.+) 毛色:(.+)毛|) { | |
$sex = $1; | |
$keiro = $2; | |
} elsif (m|>父</span>(.+?)</p>|) { | |
$sire = $1; | |
} elsif (m|>母</span>(.+?)</p>|) { | |
$mare = $1; | |
} elsif (m|>母父</span>(.+?)</p>|) { | |
$bms = $1; | |
} elsif (m|>所属</span>(.+?)</p>|) { | |
$area = $1; | |
} elsif (m|>厩舎</span>(.+?)</p>|) { | |
$stable = $1; | |
} elsif (m|>育成牧場</span>.+>(.+)</span>|) { | |
$farm = $1 | |
} elsif (m|一口出資額</span><strong class="red2">(\d+),000</|) { | |
$price = int($1) * 1000; | |
# ここで表示 | |
$line = join("\t", ($name, $sex, $price, $sire, $mare, $bms, $area, $stable, $farm, $keiro)) . "\n"; | |
$line =~ s/'/'/g; | |
print $line; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment