Here there are two text values of understanding, one text within the html tag, the second is the page displayed in the page text two differences: whether visible to the average user.
One: get the entire html web page text:
document.documentElement.textContent;
Two: Get the text on the page displayed:
document.documentElement.innerText;