當使用 WebRequest 來 Get 網址時,出現"已經嘗試太多次自動重新導向"。
通常為對方網站有進行某種判斷。以下為試過的項目。
上次是將 CookieContainer 設定一個 New Net.CookieContainer 即可。
Dim http As Net.HttpWebRequest = Net.WebRequest.Create(Url)
http.Method = "GET"
http.ContentType = "application/x-www-form-urlencoded;"
http.UserAgent = "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.0; Win64; x64; Trident/5.0)"
http.CookieContainer = New Net.CookieContainer
http.Referer = Url