Board index » cppbuilder » Indy (other other) web browser code

Indy (other other) web browser code


2008-06-30 09:35:02 PM
cppbuilder3
Having a bit of fun with indy
Basically I want to write an app that visits a few differnet web pages and
then downloads the source of the page to a text file.
I have tried indy and have not had much success, same with TccpWebBrowser
Dioes anyone either have a sample of source for the above or a suggestion of
an alternate VCL package - pref free as this is just a fun bit of coding
 
 

Re:Indy (other other) web browser code

"Paul" < XXXX@XXXXX.COM >wrote in message
Quote
I have tried indy and have not had much success,
same with TccpWebBrowser
Why not? You need to be more specific.
Gambit
 

Re:Indy (other other) web browser code

When i call the connect method I get an 11004 exception, this same bit of
code worked in an older version of indy
TCP->Host = "www.google.com";
TCP->Port = 80;
TCP->Connect();
 

{smallsort}

Re:Indy (other other) web browser code

"Paul" < XXXX@XXXXX.COM >wrote in message
Quote
When i call the connect method I get an 11004 exception
That is because you are using the Host property wrong. You need to change
this:
TCP->Host = "www.google.com";
To this instead:
TCP->Host = "www.google.com";
With that said, you should be using the TIdHTTP component instead of the
TIdTCPClient component directly. Then you can do this:
AnsiString PageSource = HTTP->Get("www.google.com");
Or this:
TFileStream *PageSource = new TFileStream("c:\\some
folder\\somefile.html");
HTTP->Get("www.google.com", PageSource);
delete PageSource;
Quote
this same bit of code worked in an older version of indy
No, it didn't. The Host property has never worked the way you are trying to
use it.
Gambit