Rendering Modified HTML in WebBrowser Control 
Author Message
 Rendering Modified HTML in WebBrowser Control

I have a VB app that has the browser control in it to navigate html pages.
There are certain pages that have a banner on them that I would not like
displayed when viewing with the VB app (I want the banner when view in
straight IE)

Is there anyway to parse the HTML - take out the banner - then tell the
WEbbrowser control to render the modified HTML?

I thought of using the InetCtl to download the HTML - then parse it and save
to a local file  then have webbrowser display that - seems kinda bulky
though.

Regards



Tue, 09 Sep 2003 19:53:06 GMT  
 Rendering Modified HTML in WebBrowser Control

Quote:
>I have a VB app that has the browser control in it to navigate html pages.
>There are certain pages that have a banner on them that I would not like
>displayed when viewing with the VB app (I want the banner when view in
>straight IE)

>Is there anyway to parse the HTML - take out the banner - then tell the
>WEbbrowser control to render the modified HTML?

>I thought of using the InetCtl to download the HTML - then parse it and save
>to a local file  then have webbrowser display that - seems kinda bulky
>though.

Look at the M/S HTML Library (comes with IE5). It allows you to parse
and change the HTML in a web browser control. There's almost no info
available on it, and the following code is about all I've seen. It comes
from an MSDN article that was removed !! If you have access to MSDN CDs,
have a look for a Web Workshop article called "Scraping Web Pages". It
gives some info. It was also printed in the paper edition of MSDN News
in the May/June 2000 edition.

  ' the first bit of code adds all links to a list box

  Dim doc As IHTMLDocument2
  Set doc = wb.document ' get the HTML from the web browser
  list.Clear
  Dim anchors As IHTMLElementCollection
  Set anchors = doc.All.tags("A")
  Dim i As Integer
  For i = 0 To anchors.length - 1
    list.AddItem anchors.Item(i, i)
  Next

  ' following code from MSDN article May/June 2000
  Dim Tables As IHTMLElementCollection
  Set Tables = doc.All.tags("TABLE")
  Dim Quote As IHTMLElement
  ' get the 14th item in the table
  Set Quote = Tables.Item(14, 14).All.tags("TD").Item(2, 2)
  MsgBox Quote.innerText

--
Alan Silver
Please remove the "{*filter*}ferret" if replying by e-mail



Fri, 12 Sep 2003 02:04:38 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Rendering Modified HTML in WebBrowser Control

2. Rendering Modified HTML in WebBrowser Control

3. HTML to be rendered using the WebBrowser control

4. Trap when the WebBrowser control finishes rendering

5. Modify vertex data during rendering

6. Modify right click menu on webbrowser control

7. modifying a controls host container (dhtmledit) out if html/vbscript

8. modifying a controls host container (dhtmledit) out if html/vbscript

9. modifying a controls host container (dhtmledit) out if html/vbscript

10. ie6 webbrowser rendering problem

11. Scraping html with webbrowser Webbrowser

12. CDO and Object Rendering - HTML Mail

 

 
Powered by phpBB® Forum Software