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
  • 43,180
  • 11
  • 50
  • 79
zack
  • 137
  • 12

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
  • 43,180
  • 11
  • 50
  • 79