|
- Sub test()
- Dim ie, dmt, tb, x, y, i
- Set ie = CreateObject("InternetExplorer.Application")
- With ie
- .Visible = True '显示它
- .navigate "http://59.49.34.87:2016/Application/gongs.aspx" '加载某个页面
- Do Until .ReadyState = 4 And .busy = False '等待页面加载完毕
- DoEvents
- Loop
- Set dmt = .document
- Debug.Print dmt.body.outerhtml
- 'Stop
- For i = 1 To 10
-
-
- Set dmt = .document
- Set tb = dmt.all.tags("table")(0)
- For x = 0 To tb.Rows.Length - 1
- For y = 0 To tb.Rows(x).Cells.Length - 1
- Cells(x + 1, y + 1) = tb.Rows(x).Cells(y).innertext
- Next y
- Next x
- dmt.getElementById("GridView1_txtGoPage").Value = i + 1
- dmt.getElementById("GridView1_btnTurn").Click
- Do Until .ReadyState = 4 And .busy = False '等待页面加载完毕
- Debug.Print .busy
- DoEvents
- Loop
- 'Stop
- Worksheets.Add after:=Worksheets(Worksheets.Count)
- Next i
-
- End With
- End Sub
复制代码 |
|