对于 IE(仅限)。免费:Microsoft Internet 控制
using SHDocVw;
Microsoft HTML 对象库
using mshtml;
有了这些,你可以做类似的事情
foreach (InternetExplorer brIns in _allWindows)
{
var htmlDoc = brIns.Document as HTMLDocument;
if (htmlDoc != null && htmlDoc.all.item(elementName) != null)
{
var elem = htmlDoc.all.item(elementName) as HTMLInputElement;
if (elem != null && attributeName == null)
{
_ieCurrentDoc = htmlDoc;
_currentHtml = htmlDoc.documentElement.outerHTML;
return true;
}
if (elem != null && elem.getAttribute(attributeName) != null)
{
_ieCurrentDoc = htmlDoc;
_currentHtml = htmlDoc.documentElement.outerHTML;
return true;
}
}
}