Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21096

HELP: XMLHTTP getting very slow after fetching 200 pages

$
0
0
Hi guys, i am using VB6 and XMLHTTP to fetch different pages, 700 pages in total. It is working perfectly at the beginning, but after one or two hundred pages, it is getting very very slow, maybe a few seconds to get a page, or even die. I think it is because it is calling XMLHTTP so many times, though I had set interval to call the function.
Here is very little information about XMLHTTP I can find, pls kindly help!!

The XMLHTTP code is no problem, as below. How can I use it to fetch hundreds of pages quickly? thank you very much

Code Starts:
Public Function GetHTTPTimer(ByVal url As String, ByVal encoding As String) As String

Dim xmlHTTP As Object
Dim content As Variant

Set xmlHTTP = CreateObject("Microsoft.XMLHTTP")
xmlHTTP.Open "GET", url, True
xmlHTTP.send
Do While xmlHTTP.readyState <> 4
DoEvents
Loop
content = xmlHTTP.responseBody
If CStr(content) <> "" Then GetHTTPTimer = EncodingConvertor(content, encoding)
Set xmlHTTP = Nothing
If Err.Number <> 0 Then
GetHTTPTimer = ""
End If
On Error GoTo 0
End Function

Code Ends



William

Viewing all articles
Browse latest Browse all 21096

Trending Articles