[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: HTTPAPI and Frames



Sender: Scott Klement <sk@xxxxxxxxxxxxxxxx>


Hi Elbert,

> I connect to our bank to download a statement and the page I retrieve sais
> "Your browser doesn't support Frames"

HTTPAPI only transfers documents using the HTTP protocol.  It's not a web
browser, it neither interprets the contents of the web page that you
download, nor tries to display it.

If you want your application to behave in the same manner as a web
browser, then you have to intepret the HTML that you download and act upon
it.

When a web browser downloads an HTML document for a page with frames, that
HTML document tells it what frames to create and the URLs for the
documents that are to be loaded into each frame.

For example.  Let's say I'm connected to http://www.example.org/test.html
The file called test.html will look something like this:

<html>
<frameset cols = "10%, 80%,*">
  <noframes>
     <body>You <b>must</b> use a browser that can display frames!</body>
  </noframes>
  <frame src ="navigation.html">
  <frame src ="main.html">
  <frame src ="rightbar.html">
</frameset>
</html>

The browser interprets this file in order to display it.  It sees that it
needs to create one frame that's 10% of the window, another frame that's
80% of the window, and a final frame that's whatever is left.

Into the left frame, it loads http://www.example.org/navigation.html
Into the middle frame, http://www.example.org/main.html
and into the right frame, http://www.example.org/rightbar.html

> The webpage has the column headers in one frame, and the line item data in a
> different frame.
>
> Can HTTPAPI capture the line item data from the secondary frame?

If you want to do the same thing with HTTPAPI, you neeed to interpret the
HTML document, find the <frame> tags, and get the URLs from them.   Then,
use HTTPAPI to download each frame separately.

As I said, HTTPAPI does not try to interpret the contents of the files it
downloads -- it just downloads them.  Interpreting them is up to you :)

-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubsribe from the list send mail
to majordomo@xxxxxxxxxxxxx with the body: unsubscribe ftpapi mymailaddr
-----------------------------------------------------------------------