View Full Version : How to read text in HTML
07-09-2002, 05:25 AM
My question is, if I want to extract a specific text in a HTML page, how can I do it? For example, part of the HTML page will look like this:
07-09-2002, 07:33 AM
i don't know if this is exactly what you want:
<font id="greet" size="3">
then you can do this:
if (document.all) obj = document.all["greet"];
else if (document.getElementById) obj = document.getElementById("greet");
07-09-2002, 08:25 AM
Whenever you want to extract the contents (text) of a HTML file it is always good to use <DIV id="idName"> tags in case of IE, NS6+ and <layer id="idName"> in case of NS4.
You can get the text within the element as Glenn said.
07-09-2002, 08:44 AM
Your suggestion is to identify the content by a unique id, however, I need to identify the content by its exact value, say, the text "Hello" in my previous example.
If anyone has more suggestion, pls kindly let me know. Or, if you think it is not possible to do it, pls also let me know.
07-09-2002, 09:01 AM
maybe it's possible with DOM, try to post this to DOM scripting forum or maybe the moderators can move it themselves.
Powered by vBulletin® Version 4.2.2 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.