Option Explicit
Dim amount
Dim Page As Long, Gwlb As Long
Dim flag As Boolean
Private Sub Form_Load()
Page = 1
Gwlb = 1
flag = True
Form1.MousePointer = 11
WebBrowser1.Navigate "http://www.job168.com/recruit/index2.asp?page=1&count=456&gwlb=1&svc=%B8%F6%C8%CB%D7%D4%BC%F6" 
End Sub
Private Sub WebBrowser1_DocumentComplete(ByVal pDisp As Object, URL As Variant)
Dim Table1 As HTMLTable, Tables As IHTMLElementCollection
Dim select1 As HTMLFormElement, selects As IHTMLElementCollection
Dim Row As HTMLTableRow, Cell As HTMLTableCell
Dim i, j, tmpIf  (pDisp Is WebBrowser1.Object) Then 
On Error Resume Next
If flag Then
    Set selects = WebBrowser1.Document.getElementsByTagName("select")
    For Each select1 In selects
    If select1.Name = "page" Then
        amount = select1.length     '为何这里amount的值总是不变
        flag = False
    End If
    Next
End IfSet Tables = WebBrowser1.Document.getElementsByTagName("Table")
For Each Table1 In Tables
If Left(Table1.innerText, 2) = "姓名" Then 
For i = 0 To Table1.rows.length - 1
Set Row = Table1.rows(i)
j = 0
For Each Cell In Row.cells
Text1 = Text1 + Trim(Row.cells(j).innerText) + vbTab
j = j + 1
Next
Text1 = Left(Text1, Len(Text1) - 1) + vbCrLf
Next
Open "C:\Data.xls" For Append As #1
Print #1, Left(Text1, Len(Text1) - 2): Text1 = "": Close #1
Exit For
End If
NextPage = Page + 1
tmp = "http://www.job168.com/recruit/index2.asp?page=" + _
Trim(Str(Page)) + "&count=456&gwlb=" + Trim(Str(Gwlb)) + "&svc=%B8%F6%C8%CB%D7%D4%BC%F6"
If Page <= amount Then 
WebBrowser1.Navigate tmp
Else    If Gwlb <= 16 Then
        flag = True
        amount = 0
        Gwlb = Gwlb + 1
        Page = 1
        tmp = "http://www.job168.com/recruit/index2.asp?page=" + _
Trim(Str(Page)) + "&count=456&gwlb=" + Trim(Str(Gwlb)) + "&svc=%B8%F6%C8%CB%D7%D4%BC%F6"
        WebBrowser1.Navigate tmp
    Else
        Form1.MousePointer = 0
        MsgBox "Finished!!": End
    End If
        
End If
End Sub
------------------------------------------------------------------------------------
上面代码中的 这句  amount = select1.length    为何这里amount的值总是不变。