473,386 Members | 1,758 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Dynamically inspecting HTML DOM from the outside of a browser

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
4 1689
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Laura | last post by:
Hello, Newbie question: Does anyone know how to dynamically set the screen width in an applet? I have an applet that creates a horizontal bar menu on a webpage, and I would like the width to be...
27
by: Nicholas Couch | last post by:
I have a little form with a couple of dynamically generated list boxes. When the user makes a selection from the first box, the second box is refreshed. When they make a selection from the second...
6
by: NotGiven | last post by:
I want to learn moer of what I saw in a recent example. They create a page that created new fields/element. It's not like they were hidden and they displayed them, they were not there, then the...
20
by: David | last post by:
I have a one-line script to add an onunload event handler to the body of the document. The script is as follows: document.getElementsByTagName("BODY").onunload=function s() {alert("s")} Now...
3
by: dalei | last post by:
My question is presented more clearly in following web page: http://www.pinyinology.com/signs2.html <html> HTML entities display outside script tags: a&sup1;, a&sup2;, a&sup3;, a⁴ But...
8
by: Donald Xie | last post by:
Hi, I noticed an interesting effect when working with controls that are dynamically loaded. For instance, on a web form with a PlaceHolder control named ImageHolder, I dynamically add an image...
7
by: Ryan Taylor | last post by:
Hi. I have some code that dynamically generates a PDF and spits this content directly to the web browser. I use HTMLDoc to create the Pdf's from html. So the user can click on a button "Print...
11
by: Daz | last post by:
Hello everyone. I am sure the answer to my question is simple, but I can't seem to dynamically add an onClick event to my script. I have a table which is generated dynamically, I am just...
9
by: Marky1124 | last post by:
Hi, I am hoping that someone can offer me some advise. I am new to CSS layouts and I've struggled to produce the screen layout that I wanted. Here's my demonstration page:- ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.