?
Solved

How to retrieve a variable from a webpage ?

Posted on 2005-02-26
3
Medium Priority
?
220 Views
Last Modified: 2010-04-05
Dear Experts!

I need a function, that can retrieve a value from a web page. The purpose of this is to retrieve the external IP address for a machine, querying
a web page, basically, once called, the webpage will return the ip address of the client.

Any idea on how we could do this?

Thank you in advance!

Dave.
0
Comment
Question by:dcrudo
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 5

Expert Comment

by:Greybird
ID: 13411230
Use the IdHTTP component, and its Get method. When you have the page in an AnsiString, it's easy to get the variable you need.
0
 
LVL 5

Accepted Solution

by:
Greybird earned 2000 total points
ID: 13411245
var
  PostDataStream : TStringStream;
  WebPageContent : AnsiString;
begin
  DataStream := TStringStream.Create('');
  try
    IdHTTP1.Get('http://somesite.com', DataStream);
    WebPageContent  := DataStream.DataString;
  finally
    DataStream.Free;
  end;
end;
0
 
LVL 1

Author Comment

by:dcrudo
ID: 13412240
works perfectly!!! Thx a lot!
0

Featured Post

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Suggested Courses
Course of the Month9 days, 8 hours left to enroll

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question