Bizarro Question of the month...

Dar Scott dsc at swcp.com
Sat Aug 31 16:33:00 EDT 2002


On Saturday, August 31, 2002, at 01:57 PM, Richard MacLemale wrote:
>
> I thought I'd use MetaCard to grab each printer's web page and 
> then parse
> through it to grab the page count.  But it won't work, because the "web
> page" is actually generated via JavaScript.
>
> Anyone have any ideas on how I could make this work?  I figured it 
> couldn't
> hurt to ask.
>
The JavaScript probably does one of these:
1. Makes a network query and inserts the result into the html.
2. Inserts a frame into the html.
3. Inserts the data into the html.

Look and see.  You likely find some browser tests at the top.  Near 
the bottom of the script your might will see some writes.  Look at 
those.

If #1, make the same query.

If #2, go to the page and examine it recursively.

If #3, parse that for the data.

My printer is #2, #2, #3.  In my case, my script would load only 
the third level html and parse that.  I found the number of pages 
on a line by itself.

Dar Scott





More information about the metacard mailing list