Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #29738
| From | Dr J R Stockton <reply1600@merlyn.demon.co.uk.invalid> |
|---|---|
| Newsgroups | comp.lang.javascript |
| Subject | Searching the visual appearance of a Web page? |
| Date | 2016-02-29 23:14 +0000 |
| Organization | Home |
| Message-ID | <wW01wWroDN1WFw8z@invalid.uk.co.demon.merlyn.invalid> (permalink) |
I have a reference to the body element of a local Web page, and can
assume that body.onload() has finished. I also have a RegExp, which has
been defined from the value of an input type=text element.
I want to apply that RegExp to the whole displayed text, all at once or
piecemeal, and get all of the matches. I have been using the match
method on body.innerText, body.innerHTML, or body.textContent, which was
good enough to do what I wanted, but not ideal.
For example, the text up<br>on in the HTML source must be treated as the
two words "up on" and not the one word "upon". And, if practical,
"câm" should be treated as a three-letter word.
The immediate aim is to use something like /\b[A-Z]{4,}\b/gi to find all
upper-case "word"s of four or more letters, in order to discover most of
the acronyms without too many false positives or negatives, so that a
list of them can be converted into, or used to check, a Glossary.
It can be assumed that the authors of the pages are not trying to delude
this searcher?
How should it best be done, in outline?
--
(c) John Stockton, Surrey, UK. ¬@merlyn.demon.co.uk Turnpike v6.05 MIME.
Merlyn Web Site < > - FAQish topics, acronyms, & links.
Back to comp.lang.javascript | Previous | Next — Next in thread | Find similar | Unroll thread
Searching the visual appearance of a Web page? Dr J R Stockton <reply1600@merlyn.demon.co.uk.invalid> - 2016-02-29 23:14 +0000
Re: Searching the visual appearance of a Web page? Martin Honnen <mahotrash@yahoo.de> - 2016-03-01 11:39 +0100
Re: Searching the visual appearance of a Web page? Dr J R Stockton <reply1600@merlyn.demon.co.uk.invalid> - 2016-03-03 23:25 +0000
Re: Searching the visual appearance of a Web page? "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2016-03-03 16:27 -0800
Re: Searching the visual appearance of a Web page? Dr J R Stockton <reply1600@merlyn.demon.co.uk.invalid> - 2016-03-05 23:37 +0000
Re: Searching the visual appearance of a Web page? Bart Van der Donck <bart@nijlen.com> - 2016-03-02 00:49 -0800
csiph-web