webbrowser无法获取新页面中的全部元素
private void webBrowser1_Navigated(object sender, WebBrowserNavigatedEventArgs e){
url = webBrowser1.Url.ToString();
if (!e.Url.ToString().Contains("welcome.php"))
return;
if (url == "http://192.168.1.8/mainFrame.php" && e.Url.ToString() == "http://192.168.1.8/attendance/welcome.php")
{
try
{
HtmlDocument doc = webBrowser1.Document.Window.Frames["mainFrame"].Document;
for (int i = 0; i <doc.All.Count; i++)
{
Console.WriteLine(i + " " +doc.All[i].TagName.ToString());
}
} catch (Exception ex)
{
throw ex;
}
}
}
无法获得全部的元素,大约能获取38个,而这个框架中大约有100多个,不知道咋么获得全部元素并对一部分元素进行操作