How can i grab text ONLY from a website html but only the text and not the html?
i want to grab this site
http://kramansro.net/lunia/sites.html
i used this code
TextBox1.Text = WebBrowser2.DocumentText
But when i grab it it comes out like this
sdfasdfad<br>asdfasdfa<br>dfasdf<br>aasd<br>fs<br>dfa<br>开发者_如何学Csdf<br>asdf<br>asd<br>f<br>as
But i want it to be this:
sdfasdfad
asdfasdfa
dfasdf
aasd
fs
dfa
sdf
asdf
asd
f
as
Well the simplest method for that particular use case would be
TextBox1.Text = WebBrowser2.DocumentText.Replace("<br>", vbCrLf);
If you have more complex HTML, you should look into Regular Expressions.
精彩评论