- Properties and events for WebBrowser
- WebBrowser How to jump page
- Web. Navigate ("");
- WebBrowser How to loop jump to get page content
BOOLLoading =true;//the variable indicates whether the Web page is loading. stringHTML =string. Empty; WebBrowser Browser=NewWebBrowser (); Public voidGethtml (string[] URLs) {Browser. Navigated+=NewWebbrowsernavigatedeventhandler (browser_navigated); foreach(stringUrlinchURLs) {Loading=true;//indicates that a load is being loadedBrowser. Navigate (URL); while(Loading) {application.doevents ();//wait for this load to complete before performing the next loop. } } } voidBrowser_navigated (Objectsender, WebBrowserNavigatedEventArgs e) {HTML= Browser. DocumentText;//gets the HTML to.Loading=false;//when the load is complete, set the variable to False, and the next loop begins execution. }
- Full code
WebBrowser-based crawler programs