开发者

grab TEXT ONLY from website

开发者 https://www.devze.com 2023-03-26 08:17 出处:网络
How can i grab text ONLY from a website html but only the text and not the html? i want to grab this site

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消