Do tej pory pobierałem wyniki oraz ilość wygranych do Gry Mini Lotto. Teraz nie pobierają się do pliku. Fireox wyświetla i Chrome w przeglądarce. Internet Explorer nie. Jak mam dojść z poziomu delphi do tych danych?
uses wininet;
procedure HttpGetFile(url,filename:string);
var
F:File;
ResumePos,BufferLen,SumSize:DWORD;
hSession, hURL: HInternet;
Buffer: array[1..1024] of Byte;
err: boolean;
begin
SumSize:=0;ResumePos:=0;
AssignFile(F,filename);
IF FileExists(filename) then
begin
Reset(f,1);
ResumePos:=FileSize(F);
Seek(F,FileSize(F));
end else ReWrite(f,1);
//CloseFile(F); // TU nie
hSession:=InternetOpen('Mozilla/4.0 (compatible; MSIE 6.0; Windows NT)',0,nil,nil,0);
hURL:=InternetOpenURL(hSession,PChar(url),nil,0,0,0);
InternetQueryDataAvailable(hURL, SumSize,0,0);
//form1.label1.Caption:=IntToStr(SumSize);
if ResumePos>0 then InternetSetFilePointer(hURL,ResumePos,nil,0,0);
repeat
err:=InternetReadFile(hURL, @Buffer,SizeOf(Buffer),BufferLen);
if err=false then begin Form1.Label3.Caption := 'BŁĄD !!!';exit;end;
BlockWrite(f,Buffer,BufferLen);
Application.Processmessages;
until (BufferLen=0);
Form1.Caption := 'GOTOWE !!!';
CloseFile(F); // TU
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
HttpGetFile('http://app.lotto.pl/wyniki/?type=el', ExtractFilePath(Application.ExeName)+'WYNIKI1.txt');
HttpGetFile('http://app.lotto.pl/wygrane/?type=el', ExtractFilePath(Application.ExeName)+'WYNIKI2.txt');
end;
olesio napomknę, że synapse też nie daję sobie rady z tym. Lotto od 18.06.2020 roku zrobiło remont strony internetowej.
Próbowałem https://pl.wikipedia.org/wiki/User_agent.
TO PYTANIE BARDZIEJ DO ZNAJĄCYCH SIĘ NA SILNIKACH PRZEGLĄDAREK INTERNETOWYCH.