Quantcast
Channel: VBForums
Viewing all articles
Browse latest Browse all 15589

best way to get or save utf-8 content url faster?(https support)

$
0
0
hi
i am use this code for get content https url and save as utf but usually i should be wait for more than 5 or 6 or more seconds for get result.
for example i need work with this site https://divar.ir/v/AYP9IPbF so this is https.
Code:

    Set http = New WinHttpRequest
    http.Open "GET", tx.Text, False
    http.Option(WinHttpRequestOption_SslErrorIgnoreFlags) = SslErrorFlag_Ignore_All
    http.SetRequestHeader "Accept-Charset", "utf-8"
    http.SetRequestHeader "Content-Type", "application/x-www-form-urlencoded"
    http.SetRequestHeader "User-Agent", "Firefox 61.0"
    http.Send
   
    Dim r As New ADODB.Stream
    r.Open
    r.Position = 0
    r.Type = adTypeText
    r.Charset = "utf-8"
    r.LineSeparator = adCRLF
    r.WriteText http.ResponseText, stWriteLine
    r.SaveToFile App.Path & "\tmp.html", adSaveCreateOverWrite
    r.Close
    Sleep 10
  .
  .
  .

any better idea or code for fast download.
i can use chilkat like as :

Code:

Dim http As New ChilkatHttp and fast work

' Send the HTTP GET and return the content in a string.
Dim html As String
html = http.QuickGetStr("http://www.wikipedia.org/")
If (http.LastMethodSuccess = 0) Then
    Debug.Print http.LastErrorText
    Exit Sub
End If

Debug.Print html

but i dont want use chilkat dll.

Viewing all articles
Browse latest Browse all 15589

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>