Private Sub Command1_Click() Wb1.Navigate "http://warlord.duowan.com/f1.html" '連接到網(wǎng)站 End Sub Private Sub WB1_DocumentComplete(ByVal pDisp As Object, URL As Variant) Dim vDoc, vTag Dim i As Integer Set vDoc = Wb1.Document List1.Clear For i = 0 To vDoc.All.length - 1 If UCase(vDoc.All(i).tagName) = "INPUT" Then ' 查找Object屬性為Input的可輸入項 Set vTag = vDoc.All(i) List1.AddItem vDoc.All(i).tagName If vTag.Type = "text" Or vTag.Type = "password" Then Select Case vTag.Name Case "username" '如果是用戶名的那個框 vTag.Value = "xxxxxxx" '這個是用戶名 Case "passwd" vTag.Value = "xxxxxxxxx" '這個是密碼 Case "sessioncode" vTag.Value = "xxxx" '這個是驗證碼 End Select With vDoc.All(i) If UCase$(.tagName) = "INPUT" Then ' 查找Object屬性為Input的可輸入項 '如是,則判斷其是否是制定圖片鏈接,并可點擊 If UCase$(.Type) = "IMAGE" And .src = "http://warlord.duowan.com/f1.html#" Then .Select '模擬選擇圖片 .Click '模擬鼠標(biāo)單擊 End If End If End With End If End If Next i End Sub 這是我在網(wǎng)上找的,經(jīng)過整理,驗證過。 我現(xiàn)在也在做這方面事。 現(xiàn)階段在最難得就是驗證碼! |