webbrower在爬网页时有的网站点击某个按钮后会弹出一个新页面,但是webbrower这个时候就不行了
解决方式:引用SHDocVw.dll(路径在c:\windows\system32\shdocvw.dll)
private static SHDocVw.WebBrowser_V1 Web_Sub = null;
Web_Sub = (SHDocVw.WebBrowser_V1)this.webbrower1.ActiveXInstance;
Web_Sub.NewWindow += new SHDocVw.DWebBrowserEvents_NewWindowEventHandler(Web_Sub_NewWindow);
private void Web_Sub_NewWindow(string URL, int Flags, string TargetFrameName, ref object PostData, string Headers, ref bool Processed) {
Processed = true;
webSub.Navigate(URL);
}