Our vBulletin migration is complete.
Welcome vBulletin users! All content and user information from the Micro Focus Forums (vBulletin) site has been migrated to this site. READ MORE.
Amanda_Smith Valued Contributor.
Valued Contributor.

Get innertext of the entire page with spaces



I need to make sure that certain words or phrases do not appear within a page. When I am getting an innertext of the page, some of the text, partivularly the text from Webtables comes combines as one big word. If I searh for the words that should not be visible on the page, sometimes these long combined words or the words which have shorter words in them give me an issue.

E..g.:   word  'revia' is found is 'abbREVIAtion', or 

'ogen' is found withing 'dermatogen'

Using spaces when searching for these words does not help, because then it would not find the words in the combined long words  like 'encounterfornormalpregnancy', if I'm seraching for the word ' pregnancy ' with spaces around.


Please help


2 Replies
liorde Honored Contributor.
Honored Contributor.

Re: Get innertext of the entire page with spaces

Hi Amanda.

In this case, you know which words should NOT exist.  When looking for the word that should not exist, what you should do is check what exists one step left and one step right from the word.

Example. if the word 'REVIA' should not exist then check for existing instances of REVIA. throughout your page If a match  is found then check what comes one character before 'R' and one character after 'A'.

If it is BOTH spaces, then you found word which should not exist.
If there is at least one character from either side, example:
then this is not a good match, so carry on the search.

Does this make sense to you ?

Amanda_Smith Valued Contributor.
Valued Contributor.

Re: Get innertext of the entire page with spaces

yes, thank you, that makes sense, and I have tried this but unfortunately this won't work.

As I mentioned, the page has lots of Webtables, and when I get innertext of the page, the innertext of these webtables comes as one big word. For example, if the table has name, date, and some kind of procedure, it would be something like this:

in this case, if certain word - Alcohol, that should not be there for certain type of user, is not surrounded by spaces, and that approach would not work.

The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.