how do you modify a html page in webbrowser control

catdance

Member
Joined
Aug 5, 2009
Messages
13
Programming Experience
Beginner
for example how do u delete on row in a table?
how do you remove a <img /> entry?

by remove means not just set the innerText to “”
thanks
 
when i was trying to do this

VB.NET:
            Dim HTML As System.Windows.Forms.HtmlDocument = wb.Document
            Dim HTMLI As HtmlElement
            For Each HTMLI In HTML.GetElementsByTagName("td")
                If HTMLI.InnerText = "abcde" Then
                    Dim doc As mshtml.IHTMLDocument2 = wb.Document.DomDocument
                    Dim child As mshtml.IHTMLDOMNode2 = HTMLI.DomElement
                    Dim domNode As mshtml.IHTMLDOMNode2 = doc
                    domNode.removeChild(child)
                End If
            Next

it gave me an exception --- invalid parameter.
 
It's probably because your 'child' is not a child of your 'doc'. HtmlElement has a Parent property.
 
Back
Top