【HKB】 2回目 JRAサイトから票数情報を取得する 2023年2月14日21時37分

いま、いちばん、ホットなのが、票数です。これが、はやく分析したい情報
です。なので、他よりも優遇して、掲載します。よろしく!


PDF siteボタン

年度単位のHTMLを取得するボタンです。

    public partial class Form1 : Form
    {

        private void button42_Click(object sender, EventArgs e)
        {
            // https://jra.jp/datafile/seiseki/report/2022.html
            // 2002~2010 2011~2023
            button42.Enabled = false;
            horserace.SaveHyo();
            button42.Enabled = true;
        }

HorseRaceクラスを追加します。

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Hyosu
{
    public class HorseRace
    {
    }
    public virtual void SaveHyo()
    {
        int year = 2002;
        while (true)
        {
            // save pdf
            string url = "https://jra.jp/datafile/seiseki/report/" + year.ToString() + ".html";
            string path = @"C:\develop\filesMaster\PDF\";
// DLL            string[] arr = XXX(url);
// file save path
            year++;
            if (year > DateTime.Now.Year) break;
        }
    }
}

DLLと書かれているところは、別途、有料のDLLにて、サイトを取得します。
単純に、URLを渡して、文字列情報を取得するだけなので、ご自身で作成されても大丈夫です。

この記事が気に入ったらサポートをしてみませんか?