I have a WebBrowser control and I will like to get all the text from that control. In other words I will like to get the same text that if I where to grab my mouse select everything from the browser and paste it in notepad. I know there are several techniques to get the text such as WebBrowser.DocumentText or innerhtml but none of those techniques gives the same text that I would get if I where to copy everything from the browser to the clipboard.
Asked
Active
Viewed 3,344 times
1 Answers
4
This should work:
webBrowser1.Document.ExecCommand("SelectAll", false, null);
webBrowser1.Document.ExecCommand("Copy", false, null);
AVee
- 3,156
- 16
- 17