1

I want to extract dynamic content from page, with exactly same as it is in webpage not plain text. I am using below block which gives the plain text but i need like attribted text.

function getDocumentTranslatedText() {
    return document.body.innerText;    
}

Any suggestion would be more helpful.

Jack Bashford
  • 40,575
  • 10
  • 44
  • 74
zack
  • 137
  • 11

1 Answers1

2

Use innerHTML to get a HTML string rather than a plain text string that you'd get from innerText.

return document.body.innerHTML;
Jack Bashford
  • 40,575
  • 10
  • 44
  • 74