By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,571 Members | 960 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,571 IT Pros & Developers. It's quick & easy.

Dynamically inspecting HTML DOM from the outside of a browser

P: n/a
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

Feb 9 '07 #1
Share this Question
Share on Google+
4 Replies

P: n/a
On Feb 9, 3:40 pm, "Philippe Roy" <p...@conceptualspeech.comwrote:
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
If you're not interested in using JavaScript for this you're probably
on the wrong list :).

-David

Feb 10 '07 #2

P: n/a
On Feb 10, 12:40 am, "Philippe Roy" <p...@conceptualspeech.comwrote:
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

Feb 10 '07 #3

P: n/a
On Feb 10, 3:22 pm, "Emmanuel" <satim...@gmail.comwrote:
On Feb 10, 12:40 am, "Philippe Roy" <p...@conceptualspeech.comwrote:
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
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/iepr...cle.php/c1239/

Feb 11 '07 #4

P: n/a
Emmanuel <sa******@gmail.comwrote:
>
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 ?
--
Artaban de Médée
Feb 11 '07 #5

This discussion thread is closed

Replies have been disabled for this discussion.