Login  
Search All Forums
Dart Home | PowerTCP Web for ActiveX | Custom Development Reply | PowerTCP Web for ActiveX Topics | Forums   
AuthorForum: PowerTCP Web for ActiveX
Topic: Traversing HTML Frames
User1134

Posts: 5
Member Since: 10/09/00
posted October 9, 2000 9:13 PM

Anyone know if the Web Tool can help me traverse a frame-based site? I'm using another tool right now, and it can't handle it (so I'm shopping for a new one, and this one seems pretty good).

I'm building a mini-bot/spider that tactically traverses sites to download specific pages, but a site that has multiple frames hangs it up!

Can this tool help me overcome frames??? Does anyone have sample code? Ideas? All constructive comments welcome!

Thanks in advance.
AJ
Tony Priest



From: Utica, NY USA
Posts: 8466
Member Since: 04/11/00
posted October 9, 2000 9:57 PM

The Web Tool delivers a page to exactly as it was received from the server. There is no interpretation done on the HTML code that is received. That is something that you would do after parsing the returned data.

The exception to this would be the case where the server redirects, in which case the URL property is changed to the redirected page and the new page is returned to you.

User1134

Posts: 5
Member Since: 10/09/00
posted October 10, 2000 8:50 AM

I understand its intent, but a browser that is looking at a frames-based web site may/is actually downloading an HTML page per frame (I say may/is because I'm still not 100% clear on this). So if the web server is trying to stream say 3 HTML pages for three different frames, which one is going into the file- or string-capture, if any?

Furthermore, a lot of pages have a <FRAMES> tag that only sends data if the browser accepts frames (there's a corresponding <NOFRAMES> tag that usually contains no data)...how to tell the website you can handle the frames?

Finally, if you can give me an example of a frame-based site and the downloaded text file you got from the component, I'd buy it in two seconds. I dunno, maybe MSDN is frame based? Just tell me the URL you tried, and attach the resultant .html file (or .txt).

Thanks,
AJ
Tony Priest



From: Utica, NY USA
Posts: 8466
Member Since: 04/11/00
posted October 10, 2000 9:00 AM

I have a better idea. Please give me the URL of a site you are having problems with. The way it should work is that the "frame page" will contain URLs to the pages that each frame uses. You would then parse them out and request them individually.
User1134

Posts: 5
Member Since: 10/09/00
posted October 10, 2000 9:26 AM

Going to email you some info.

Thanks for your prompt attention.

I agree "how" it should work, and can understand how I'd have to program it, but I haven't been able to get to "step one" because the page isn't sending data when it (somehow) detects my control can't handle frames.

AJ
Tony Priest



From: Utica, NY USA
Posts: 8466
Member Since: 04/11/00
posted October 10, 2000 9:50 AM

I used the following code (substituting your values of course):

Private Sub Command1_Click()
  On Error GoTo OnError
  Command1.Enabled = False
  Http1.Cache = False
  Http1.Url = "http://whatever/"
  Dim Data As String
  Http1.Get Data, , "user", "pass"
  Debug.Print Data
  GoTo Done
OnError:
  Debug.Print "ERROR #" + CStr(Err.Number) + ": " + Err.Description
Done:
  Command1.Enabled = True
End Sub

This returned to me a frameset that contained two frames, titleframe and subframe, both of which had urls that were parseable.

User1134

Posts: 5
Member Since: 10/09/00
posted October 10, 2000 10:26 AM

OK, why didn't I look at this control sooner???

(Tried an example with the trial-version.)

Guess I'll parse the returned HTML for the frameset info, dynamically dim a few add'l strings to hold each and work from there.

There wouldn't seem to be any "visual" capabilities of this control (nor should there be), so why isn't it creatable as an object (i.e. "CreateObject("DartWeb.Http"))??? If it IS, then I'm doing something wrong. If it isn't, take it as feedback that it should be.

Thanks. I'm going to get my CC!
--AJ
Tony Priest



From: Utica, NY USA
Posts: 8466
Member Since: 04/11/00
posted October 10, 2000 10:38 AM

It is creatable. In fact here is an example:

http://www.dart.com/Samples/http.asp

In that code, you will see the following:

Set Http1 = Server.CreateObject("Dart.Http.1")  

Be warned though, that creating the object like this means that you have to install the license key in the users registry. Otherwise the license is compiled into the executable.

User1134

Posts: 5
Member Since: 10/09/00
posted October 10, 2000 11:10 AM

I didn't have the ".1" at the end!

Is there a "support note" or somewhere that I can look at what license keys need to be installed if I should use the component that way?

How do you determine that it's not being used in the program? If I dim the object like:
Dim WithEvents myHTTP as Dart.Http.1
Then do a CreateObject on it will it detect this and compile the license in? What if I use Dim-As-New?

Are there any licensing issues if I have to register the key manually? It's still considered run-time only so I don't have to license each client, right?

Thanks,
AJ
Tony Priest



From: Utica, NY USA
Posts: 8466
Member Since: 04/11/00
posted October 10, 2000 11:21 AM

The Program ID can be found in the Help File on the controls main topic page. You also use OleView (comes with Visual Studio)

You don't Dim as Dart.Http.1, you add the DartWeb.dll as a reference and then Dim it as Http. See http://support.dart.com/KBDetail.dwp5

If you use createbject and don't have a valid license key in the registry, the user will get a trial nag.
Reply | PowerTCP Web for ActiveX Topics | Forums   
This site is powered by PowerTCP WebServer Tool PowerTCP WebServer for ActiveX