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?
那这个呢?
var text = document.getElementsByTagName('body')[0].textContent.toLowerCase();
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.