开发者

How can i grab text from a web browser?

I need to go into my implemented web browser and take text from lets say a label on the page. For example on this page it says "Related Questions" I need to copy that text and paste it into my f开发者_高级运维rom. Thanks in advance :)


Apparently you're using a WebBrowser element to show a homepage on your form. Use the following short code snippet to get the source code of the website you're viewing (the source code will be written into the TextBox1 in that example). Now you'll just have to filter out whatever you need (in your case it's a certain text which is hopefully between two HTML elements for ease). You might need RegEx for that (in case you're looking for an easy solution).

TextBox1.Text = WebBrowser1.DocumentText
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜