HOW TO leverage HTMLDocument, instend of IHTMLDocument2
HI GUYS,
NOW WITH C#, I got some problem here , pls help me out .
I wanna use the "getElementsByTagName" as what i did in javascript , to fetch the htmlElements , then I might inspect and kick off some action of it like click();
but with below code I cannot leverage to the "getElementsByTagName" func, this func is only available in "System.Windows.Forms.HTMLDocument" Class .
could u hele me to translate the "getIHTMLDocument2ByUrl" func to "getHTMLDocumentByUrl" ?
public mshtml.IHTMLDocument2 getIHTMLDocument2ByUrl(string url)
{
SHDocVw.ShellWindows shellWindows = new SHDocVw.ShellWindows();
foreach (SHDocVw.InternetExplorer ie in shellWindows)
{
string filename = System.IO.Path.GetFileNameWithoutExtension(ie.FullName).ToLower();
if (filename.Equals("iexplore") && ie.LocationURL == url)
{
return ie.Document as mshtml.IHTMLDocument2;
}
}
return null;
}