2

I am just wondering if there is any approach to catch only some part of the web page using WPF and show up it?

Any ideas?

Thank you!

2
  • 1
    Like go into the HTML and only take a part of the HTML out and stick it in the browser control? Commented Feb 10, 2012 at 13:55
  • @Hexxagonal Yeah... Do you have any stupid sample how to do it? Commented Feb 10, 2012 at 13:57

2 Answers 2

1

You will need to reference SHDocVw.dll. From there, it is a matter of casting WebBrowser.Document to MSHTML.IHTMLDocument2 and using IntelliSense to figure out how to access the DOM and remove what you don't want.

Sign up to request clarification or add additional context in comments.

Comments

0

Here is my solution.

mshtml.IHTMLDocument2 doc = (IHTMLDocument2)MainBrowser.Document; if (null != doc) { foreach (IHTMLElement element in doc.all) { if (element.id == "wrapper") { HTMLDivElement container = element as HTMLDivElement; dynamic dd = container; string result = dd.IHTMLElement_innerHTML; // You get ANY member of HTMLDivElementClass break; } } } 

enter image description here

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.