- ©«¤l
- 5923
- ¥DÃD
- 13
- ºëµØ
- 1
- ¿n¤À
- 5986
- ÂI¦W
- 0
- §@·~¨t²Î
- win10
- ³nÅ骩¥»
- Office 2010
- ¾\ŪÅv
- 150
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥xÆW°ò¶©
- µù¥U®É¶¡
- 2010-5-1
- ³Ì«áµn¿ý
- 2022-1-23
|
¥»©«³Ì«á¥Ñ GBKEE ©ó 2017-3-28 13:20 ½s¿è
¦^´_ 1# lalalada
1. IE ºô§} http://pivot.tii.org.tw/lifesta/DQPFrame1.htm ,(³]¦nn¬d´Mªº¶µ¥Ø) ,«ö¤U[¶}©l¬d´M]
2.¦bExcel ¤W°õ¦æ,vbaµ{¦¡- Option Explicit
- Sub Ex()
- '½Ð¥ý±N±M®× [³]©w¤Þ¥Î¶µ¥Ø]¥[¤J Microsoft Internet Controls
- Dim shell_windows As New SHDocVw.ShellWindows
- Dim Ie As SHDocVw.InternetExplorer
- For Each Ie In shell_windows
- With Ie
- Do While .Busy Or .ReadyState <> 4: Loop
- If InStr(.Document.Title, "²£ª««OÀI·~°È²Îp¬d¸ßµ²ªG") Then .Quit
- End With
- Next
- Ex_²£ª««OÀI·~°È²Îp¤U¸ü
- End Sub
- Sub Ex_²£ª««OÀI·~°È²Îp¤U¸ü()
- Dim i As Integer, P, xTab As Object, R, C, II
- With CreateObject("InternetExplorer.Application")
- ' .Visible = True
- Do
- .Navigate "http://pivot.tii.org.tw/lifesta/NLifeResult.asp?page=" & i + 1
- Do While .Busy Or .ReadyState <> 4: DoEvents: Loop
- Set xTab = .Document.all.tags("table")
- If i = 0 Then
- P = Split(xTab(2).innertext, ")")(0)
- P = Val(Split(P, "¦@")(1))
- Cells.Clear
- End If
- Application.StatusBar = "¦@ " & P & " ¶ / ²Ä " & i + 1 & " ¶"
- For R = IIf(i = 0, 0, 1) To xTab(1).Rows.Length - 1
- For C = 0 To xTab(1).Rows(R).Cells.Length - 1
- Cells(II + 1, C + 1) = xTab(1).Rows(R).Cells(C).innertext
- Next
- II = II + 1
- Next
- i = i + 1
- Loop Until i = P
- .Quit 'Ãö³¬ºô¶
- End With
- End Sub
½Æ»s¥N½X |
|