PDA

View Full Version : Getting the contents of a web object



sferguson
11-14-2003, 02:54 PM
Is there any way to get the source of a web object? Or the contents of the page into a string?

Corey
11-14-2003, 04:07 PM
Yep sure, that's easy. Is the page local or remote?

Corey Milner
Creative Director, Indigo Rose Software (http://www.indigorose.com)

sferguson
11-14-2003, 05:08 PM
Remote. ???

Corey
11-14-2003, 05:10 PM
Sorry, is the page on your computer or on the internet? (is what I should have asked) Once I know that I can work out the best/easiest method for you. [although both are do-able]

Corey Milner
Creative Director, Indigo Rose Software (http://www.indigorose.com)

sferguson
11-14-2003, 10:53 PM
remote.

JimS
11-15-2003, 04:18 AM
Try this

JimS
11-15-2003, 05:07 AM
Sorry about that, I wasn't paying attention that you are using version 5. It's too late for me to edit the post.

After I posted that first example, I realized it would only work for the index page of a website, so I rewrote it to work properly with other pages, but I've done it all in version 4, so I won't bother uploading the fix.


Sorry about that, I need to pay more attention to which forum is being posted to.

sferguson
11-15-2003, 08:13 AM
Just for the record, I'd still be grateful for the "fix" version built for 4.0.

I'm new to v4.0 (began working with 4 within the last couple of months), and it may go without saying that I'm super-new to v5.0 :D . So on my current project I'm experimenting with both, but just assumed that it might be more easily handled in v5 since it's the latest and greatest.

Corey
11-15-2003, 09:27 AM
Hi, here's how to get a remote file into a variable and display it in a dialog box, cut and paste these 3 actions into a new document's first Page "OnShow" event for a demo:


HTTP.Download("http://www.google.com/intl/en/index.html", _SourceFolder.."\\myfile.html", MODE_TEXT, 20, 80, nil, nil, nil);

result = TextFile.ReadToString(_SourceFolder.."\\myfile.html");

Dialog.Message("Notice", result);

Corey Milner
Creative Director, Indigo Rose Software (http://www.indigorose.com)

JimS
11-15-2003, 12:03 PM
Here's the fix I built, but remember it's for version 4. Corey's way in version 5 is easier.

sferguson
11-15-2003, 02:23 PM
Fellas,

THANKS!!!