Pergunta

I am using document.documentElement.textContent.toLowerCase() to read a website text content, the problem is this website has so many css and js code before any real text that I don't even get the complete text, it gets trunked in some part of the css.

How can I remove all the css and js code to retrieve only the text content?

Foi útil?

Solução

What about this?

var text = document.getElementsByTagName('body')[0].textContent.toLowerCase();
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top