I want to use currently loaded webpage in internet explorer as HtmlDocument
in HtmlAgilityPack. I am using explorer document through mshtml as COM object.
mshtml.HTMLDocument doc = explorer.Document as mshtml.HTMLDocument;
Then I've tried to convert it to HtmlDocument which is using in HtmlAgilityPack
HtmlAgilityPack.HtmlDocument hdoc = (HtmlAgilityPack.HtmlDocument)doc;
But it's not working due to invalid cast operation. Exception message is shown below.
Anyhow I want to use currently loaded webpage as source to htmlagilitypack, I know that I can use HtmlWeb provided by htmlagility pack and load current url but I want to highlight elements which are in the loaded page (elements found using htmlagilitypack) I guess it cannot be done through that kind of implementation. Any ideas to implement this any support will be great. thanks.