I have created a webbrover in C # and I want to be able to select the part of the web page and to reveal the source The work that I have done so far in a text box so far is using the full page source:
Private Zero btnSource_Click (Object Sender, EventArgs e) {string PageSource; Mshtml.HTML Document objHtmlDoc = (mshtml.HTMLDocument) webBrowser1.Document.DomDocument; PageSource = objHtmlDoc.documentElement.innerHTML; RTBSource.Text = PageSource; }
In this way I have more information than I am only looking for a small part of the page at a time.
Using string containing method will be problematic because the text on web page contains many super scripts characters, making super-scripted characters in regular letters to make and copy the normal copy, which I Can not get rid through regexp
If I can work with the source, then it would be better luck to eliminate one and other tags.
Any suggestions?
Compiler: C # 2010 Express App: WinForm OS: XP SP3
Try
HTMLElementCollection ALM = Web Browser 1. Document. Body. all;
In Elm you will have all the elements of the webpage and you can get the text of the third element for the test like this
elm [2] .innerhtml
Comments
Post a Comment