Forum > Networking and Web Programming

[SOLVED] How to read data from an URL address


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 "". 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

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  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---uses httpsend; procedure Button1Click(Sender: TObject);  var    s: TMemoryStream;begin  s := TMemoryStream.Create;  try    HttpGetText('', s);    s.Position := 0;    Memo1.Lines.LoadFromStream(s);  finally    s.Free;  end;end; 
Sorry, above code wrong format your link.

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);
response: Tstringlist;
result: boolean;
  Response := TStringList.Create;
  HTTP := THTTPSend.Create;
    Result := HTTP.HTTPMethod('GET', '');
    if Result then


Thanks to all. PROBLEM SOLVED! :D                      


[0] Message Index

Go to full version