Code: Alles auswählen
begin
SL := TStringList.Create;
try
httpsend.HttpGetText('https://coinranking.com/', SL);
SL.SaveToFile(Anwendungsdatenordner+'CryptoKurse.dat');
StringGridCrypto.RowCount := 51;
StringGridCrypto.ColWidths[0] := 19;
StringGridCrypto.Width:=189;
begin
SL := TStringList.Create;
SL.LoadFromFile(Anwendungsdatenordner+'Cryptokurse.dat');
Seitentext := copy(SL.Text, 2, 165000);
for i := 0 to 49 do
begin
StringGridCrypto.Cells[0,(i+1)] := IntToStr(i+1);
Anfang := Pos('</a> <span class="profile__subtitle">',Seitentext);
Seitentext := copy(Seitentext, Anfang+40);
Temptext := Trim(Copy(Seitentext, 1, 14));
StringGridCrypto.Cells[1,(i+1)] := Temptext;
Anfang := Pos('$', Seitentext);
Seitentext := copy(Seitentext, Anfang+20);
Temptext:=Trim(Copy(Seitentext,1,15));
Preis:= StringReplace(Temptext, ',', '', [rfReplaceAll]);//löscht alle Kommas
Preis := StringReplace(Preis,'.', ',',[rfReplaceAll]);//tauscht Punkt in Komma
StringGridCrypto.Cells[2,(i+1)] := Preis;
end;
StringGridCrypto.Cells[0,(0)] := '';
except
exit;
end;