CREATE CURSOR 大乐透 (红1 C(2), 红2 C(2), 红3 C(2),红4 C(2),红5 C(2),兰1 C(2),兰2 C(2),期号 C(5),球具 C(1))
FOR iii=1 TO 20
lcUrl = "https://webapi.(STR(iii))
oHTTP=NEWOBJECT("MSXML2.XMLHTTP")
oHTTP.Open("GET", lcUrl, .F.)
oHTTP.SETREQUESTHEADER("Content-Type", "text/html;charset=UTF-8")
oHTTP.Send()
lcText = oHTTP.ResponseText
FOR lnj = 1 TO OCCURS("lotteryDrawNum", lcText)
lyText = STREXTRACT(lcText,',"lotteryDrawNum":"','"', lnj)
qjtext = STREXTRACT(lcText,',"lotteryEquipmentCount":' ,',"', lnj)
lmText = STREXTRACT(lcText,'lotteryUnsortDrawresult":"','"', lnj)
h1 = Substr(lmText ,1,2)
h2 = Substr(lmText ,4,2)
h3 = Substr(lmText ,7,2)
h4 = Substr(lmText ,10,2)
h5 = Substr(lmText ,13,2)
l1 = Substr(lmText ,16,2)
l2 = Substr(lmText ,19,2)
INSERT INTO 大乐透 VALUES (h1,h2,h3,h4,h5,l1,l2,lyText,qjtext)
ENDFOR
ENDFOR
BROWSE