have to extract some info from an HTML File and strip out a div and I need to use classic asp.
I'm using HTMLFile object and it works everything except when I try to remove the div
here the relevant part of the routine:
.......
Set HTML = CreateObject("HTMLFile")
Set Frame = CreateObject("HTMLFile")
.........
tmp=t.ReadAll
HTML.Write tmp
t.close
Set SPN=HTML.getElementsByTagName("div")
for each sp in SPN
if sp.getAttribute("id")="frame" then
Frame.write sp.InnerHTML
exit for
end if
next
Set Divs=Frame.getElementsByTagName("div")
for each div in Divs
if div.getAttribute("id")="link_1" then
Frame.removeChild(div)
end if
next
it returns
htmlfile error '80070057'
Invalid argument
Line 57
Where command is Frame.Removechild(div)
can suggest solution or a link where can find documentation about HTMLFile Object.. since I googled a lot but apparently with wrong keywords
Thanks
Joe
I think that the Docs for HTMLFILE start here.
According to the docs for removeChild, the incantation needed to remove node X is:
If you change the delete demo code from here
to
you should get
...