Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access Interent from Delphi 7

Status
Not open for further replies.

MinalMoe

IS-IT--Management
Mar 25, 2004
62
GB
I would like to access a constant page of an internet site from within Delphi.

I think TWebBrowser is the way to do it, but I can't work out how to do that.

Could anybody please advise.

Thanks
 
I have a form with a TWebBrowser on it:
Code:
unit uSite;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, OleCtrls, SHDocVw;

type
  TfrmSite = class(TForm)
    WebBrowser1: TWebBrowser;
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  frmSite: TfrmSite;

implementation

{$R *.dfm}

end.

Then, in a button on my main form, just this:
Code:
procedure TfrmMain.btnLaunchWebSiteClick(Sender: TObject);
begin
  frmSite.Show;
  frmSite.WebBrowser1.Navigate('[URL unfurl="true"]http://www.whatever.com/');[/URL]
end;
 
I would set
Code:
WebBrowser1.Navigate('[URL unfurl="true"]http://www.whatever.com/');[/URL]
to FormOnShow.
That way it will show at once when you open up your application.
 
When you say "access", do you mean that you wish to display it in a web browser style format? Or do you mean you wish to access the source code (HTML) of that webpage to parse its contents or something?

If the former, the above suggestions are apt. If the latter, check out my posts in this thread: thread102-627709

Clive
Runner_1Revised.gif

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"To err is human, but to really foul things up you need a computer." (Paul Ehrlich)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To get the best answers from this forum see: faq102-5096
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top