Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #29738

Searching the visual appearance of a Web page?

Path csiph.com!feeder.erje.net!2.eu.feeder.erje.net!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail
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 Mon, 29 Feb 2016 23:14:48 +0000
Organization Home
Lines 28
Message-ID <wW01wWroDN1WFw8z@invalid.uk.co.demon.merlyn.invalid> (permalink)
Mime-Version 1.0
Content-Type text/plain;charset=iso-8859-1
Content-Transfer-Encoding 8bit
Injection-Info mx02.eternal-september.org; posting-host="01da9e6251d9b3ee47bb70bebae42d53"; logging-data="7396"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/gVWSxRkAr0XofKVg5arBefo01wypydk4="
User-Agent Turnpike/6.05-S (<hY+ExRCkcsssDA9uJ+0bCn8+UA>)
Cancel-Lock sha1:lsLnRxpFyREPo2vQfSAIcr+rh7g=
Xref csiph.com comp.lang.javascript:29738

Show key headers only | View raw


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&acirc;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 | NextNext in thread | Find similar | Unroll thread


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