2
我想做一個2步的源下載過程。所以我有一個像等待,直到網頁瀏覽器加載第一頁Visual Basic Net
WebBrowser1.Navigate("http://www.first-site.com")
'HERE code for downloading and saving the source code of the site into a variable
'Directly after having downloaded the source, open the second site and do the same
WebBrowser1.Navigate("http://www.first-site.com/sub-site")
'Download the Source code into one string variable
的問題是,我的網頁瀏覽器會後直接相互加載兩個網站非常非常快,不會讓我下載來源爲這兩個網站。
我嘗試了一切,我用google搜索「等待瀏覽器加載一個網站」等等,以及與while循環有關的所有事情,以查看瀏覽器是否加載了網站會導致我的程序崩潰。
怎麼辦?
如果你只是想下載源代碼,你可能會更好過了['HttpWebRequest'](https://msdn.microsoft.com/de-de /library/system.net.httpwebrequest(v=vs.110).aspx)。 –
我的答案解決了你的問題嗎?如果是這樣,你會相應地標記它。如果沒有,請告訴我,我會盡力幫助。 – InteXX