[SOLVED] How to read data from an URL address lazarus / 38-Networking and Web Programming ---------------------------------------------------------------------- sorinr · 2011-02-13 11:02 Hi all, Can anybody give me some idea on how to read a value returned by a web page? So, let me explain my problem: 1. I need to read a value (that in fact is the exchange rate of a currency at a certain date) from a web page like "www.infovalutar.ro/bnr/YYYY/MM/DD/EUR". The web page returns the exchane rate of the currency you select, in my case EUR or it can be USD, CAD whatever. 2. I am using Lazarus 0.9.28 on a win32 machine and i have the Inet package installed. Thank you in advance for your help ---------------------------------------------------------------------- Dibo · 2011-02-13 12:24 If you have lNET, open visual example of HTTP. There is "how to" read http data from given link. Just put your link. Or, download and use synapse: 1. Add httpsend to uses section 2. Call: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i uses httpsend; procedure Button1Click(Sender: TObject);  var    s: TMemoryStream;begin  s := TMemoryStream.Create;  try    HttpGetText('http://www.infovalutar.ro/bnr/YYYY/MM/DD/EUR', s);    s.Position := 0;    Memo1.Lines.LoadFromStream(s);  finally    s.Free;  end;end;  Sorry, above code wrong format your link. ---------------------------------------------------------------------- sorinr · 2011-02-13 12:44 Hi Dibo, Thanks for your reply. I've seen it just before to post the solution I've found using HTTPsend instead of Inet. Here is the code I have used: procedure TForm1.FormActivate(Sender: TObject); var response: Tstringlist; HTTP: THTTPSend; result: boolean; begin   Response := TStringList.Create;   HTTP := THTTPSend.Create;   try     Result := HTTP.HTTPMethod('GET', 'http://www.infovalutar.ro/bnr/2011/02/13/usd/');     if Result then       Response.LoadFromStream(HTTP.Document);       edit1.Text:=Response[0];   finally     HTTP.Free;   end; end; Thanks to all. PROBLEM SOLVED!