How can I copy the visible page of a WebBrowser control? Not the HTML, just the text displayed onscreen.
A:
I'm assuming that you have the full HTML to draw from? The best way would probably be to use regular expressions to remove any html-style text.
JGB146
2010-03-28 13:18:32
There's HTML and some client-side scripts that write to the page.
Dmi
2010-03-28 13:20:10
Wow, surprised to see this as the accepted answer. For the record, I'd work to replace `/<script>[^<]*</script>/` with nothing to handle the client-side scripts and then replace `/<[^>]*>/` to remove the other html tags. The scripts pattern isn't perfect, but it will work for most cases (basically unless the script itself contains a `<` char).
JGB146
2010-08-18 22:45:30