Dynamically inspecting HTML DOM from the outside of a browser

P

Philippe Roy

We finished creating a speech recognition program (http://
www.speechvibe.com), and want to enhance its capabilities to web
browsers.

I need, from outside (so without having access nor changing any html
files) to know which anchors are accessible on the displayed html
document of the top browser window.

Is there any way to have access to the document object of the top
window WITHOUT changing any html or adding a script in the html page?
If so, we're in business, I can then associate an ID with each anchors
in the html that is displayed.

If there is a way, please give me a couple of pointers on how I could
do it. I'd ideally would want to access anchors objects from C++ (with
Visual Studio 6 and 2005).

Thanks
 
E

Emmanuel

I need, from outside (so without having access nor changing any html
files) to know which anchors are accessible on the displayed html
document of the top browser window.

Bizarre, on a Mac that would not sound like a problem, you would use a
scriptable browser (Safari) and from any script editor you would say:

tell application "Safari" to tell window 1 to do javascript
"document.body.innerHTML" (or whatever)

Don't you have that kind of feature on a PC?

Emmanuel
 
P

Philippe Roy

Bizarre, on a Mac that would not sound like a problem, you would use a
scriptable browser (Safari) and from any script editor you would say:

tell application "Safari" to tell window 1 to do javascript
"document.body.innerHTML" (or whatever)

Don't you have that kind of feature on a PC?

Emmanuel

I got it to work. Ended-up pretty easy stuff. The entire recipe on how
to do it is here:

http://www.codeguru.com/Cpp/I-N/ieprogram/article.php/c1239/
 
U

Une Bévue

Emmanuel said:
Bizarre, on a Mac that would not sound like a problem, you would use a
scriptable browser (Safari) and from any script editor you would say:

tell application "Safari" to tell window 1 to do javascript
"document.body.innerHTML" (or whatever)

do you have more deeper examples on how to use AppleScript letting
Safari doing some DOM Javascript ???


The thing i'd like to implement :

the user opens a page where they are a lot of pub surrounding a usefull
article, by mouse dragging the user select the area he wants to save,
saying it's a div and i want the AppleSCript to ask Safari saving the
page transformed, by dom manipulation to the only interesting area
choosen by the user.

For the time being i'm able to change from JavaScript the page but not
to SAVE it automatically.

Any advice ?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,434
Messages
2,571,691
Members
48,796
Latest member
Greg L.

Latest Threads

Top