对网页的数据不太了解,现在有这样的数据连接:https://api.speedlottery.com/data/racing/last.xml,我怎么读取这些数据转到数据库。

解决方案 »

  1.   

    获取内容可以用如下方法,解析xml就不多说了。需要引用 msxml, Variants
    var
      content: string;
      http: IXMLHTTPRequest;
    begin
      http := CoXMLHTTP60.Create();
      http.open('Get', 'https://api.speedlottery.com/data/racing/last.xml', false, EmptyParam, EmptyParam);
      http.send(EmptyParam);
      content := http.responseText;
      //解析xml
      http := nil;
    end;