tags:

views:

38

answers:

2

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
There's HTML and some client-side scripts that write to the page.
Dmi
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
A: 

using innerText property will remover all tags

vittore