B
B
bro-dev2018-03-30 07:47:15
HTML
bro-dev, 2018-03-30 07:47:15

How to get pure text of html page?

How to get pure text of html page? Roughly speaking, the text that is obtained in the browser if you press ctrl + a, from the layout text. It is advisable to use the browser api to avoid problems with unclosed tags or just some kind of broken layout, the browser processes everything better.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander, 2018-03-30
@satellite

If I understand your question correctly, then it is enough to call in the browser itself (developer console):
1. For the entire page: document.documentElement.innerHTML
2. Only for visible content:document.body.innerHTML

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question