我试图在新线程(consoleApplication)中使用webbrowser获取网站内容,然后从中获取,然后转到另一个网站并返回第一个。我的代码:
wb.Navigate("https://www.google.com");
while (wb.ReadyState != WebBrowserReadyState.Complete){
Application.DoEvents();
Thread.Sleep(10);
}
string content = wb.Document.Body.InnerText; <- here is error(error in screenshoot(regex is good))
//goto next website and get back to first saving all cookies
我的主题:
workerThread=new Thread(new ThreadStart(newWebBrowserStarter));
workerThread.SetApartmentState(ApartmentState.STA);
workerThread.Start();
有什么想法吗?