多次访问一个网站求教高手,谢谢!!!
我打开一个网站,下载一些图片(Inet1.Execute Geturl, "get"),当下载十几个网页时,提示多次访问该网站,就不能下载了,求教该如何作。是不是对IP进行了判断,谢谢!!!
Private Sub StartDownLoad(ByVal Geturl As String)
Dim spo%, filename$
Dim fso, f
Set fso = CreateObject("Scripting.FileSystemObject")
If Not fso.FolderExists(App.Path & "\" & DT1) Then Set f = fso.CreateFolder(App.Path & "\" & DT1)
'If Not fso.FolderExists(App.Path & "\download") Then Set f = fso.CreateFolder(App.Path & "\download")
spo = InStrRev(Geturl, "/")
filename = Right(Geturl, Len(Geturl) - spo) '»ñÈ¡ÎļþÃû
savefile.Text = App.Path & "\" & DT1 & "\" & filename
Inet1.Execute Geturl, "get" '¿ªÊ¼ÏÂÔØ
End Sub
Private Sub Inet1_StateChanged(ByVal State As Integer)
'State = 12 ʱ£¬Óà GetChunk ·½·¨¼ìË÷·þÎñÆ÷µÄÏìÓ¦¡£
Dim vtData() As Byte
Select Case State
'...ûÓÐÁоÙÆäËüÇé¿ö¡£
Case icError '11
'³öÏÖ´íÎóʱ£¬·µ»Ø ResponseCode ºÍ ResponseInfo¡£
vtData = Inet1.ResponseCode & ":" & Inet1.ResponseInfo
Case icResponseCompleted ' 12
Dim bDone As Boolean: bDone = False
'È¡µÃµÚÒ»¸ö¿é¡£
vtData() = Inet1.GetChunk(1024, 1)
DoEvents
If Len(Inet1.GetHeader("Content-Length")) = 4 Then
Open App.Path & "\" & DT1 & "\k.txt" For Append As #2
Print #2, , List2.List(INDX - 1)
Close #2
cmdGET_Click
Exit Sub
End If
Open savefile.Text For Binary Access Write As #1 'ÉèÖñ£´æ·¾¶Îļþºó¿ªÊ¼±£´æ
'»ñÈ¡ÏÂÔØÎļþ³¤¶È
If Len(Inet1.GetHeader("Content-Length")) > 0 Then ProgressBar1.Max = CLng(Inet1.GetHeader("Content-Length"))
'Ñ»··Ö¿éÏÂÔØ
Do While Not bDone
Put #1, Loc(1) + 1, vtData()
vtData() = Inet1.GetChunk(1024, 1)
DoEvents
ProgressBar1.Value = Loc(1) 'ÉèÖýø¶ÈÌõ³¤¶È
If Loc(1) >= ProgressBar1.Max Then bDone = True
Loop
Close #1
cmdGET_Click
End Select
End Sub
[解决办法]
简单的办法,清空缓存和cookie,再访问。如果还不行,就是ip限制了。
尝试代理欺骗,伪造x-forward-for,还不行就只能不断换ip了。