Hi
I am willing to extract Inner html,inner text & href of selected text form webbrowser control I tried follow but its giving innertext & inner html for complete web page and not for the text I selected
for example my html page contain following
I wish that If i select this text and click on gethtml button on winform then I will get inner html ,inner text of above html link but currently I am getting it for complete document, I know that its because of
I am willing to extract Inner html,inner text & href of selected text form webbrowser control I tried follow but its giving innertext & inner html for complete web page and not for the text I selected
for example my html page contain following
Code:
<p>The same approach is used in the <a href="http://sports.in.msn.com/">Read More</a></p>Code:
Private Sub getHTML_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles getHTML.Click
Dim htmtext = WebBrowser1.Document.ActiveElement.InnerText
intext.Text = htmtext
htmtext = WebBrowser1.Document.ActiveElement.InnerHtml
inhtml.Text = htmtext
htmtext = WebBrowser1.Document.ActiveElement.GetAttribute("href")
href.Text = htmtext
End Sub