- ©«¤l
- 161
- ¥DÃD
- 26
- ºëµØ
- 0
- ¿n¤À
- 187
- ÂI¦W
- 0
- §@·~¨t²Î
- xp
- ³nÅ骩¥»
- office 2010
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- ¨Ó¦Û
- TW
- µù¥U®É¶¡
- 2011-1-2
- ³Ì«áµn¿ý
- 2022-2-16
|
½Ð°Ý ¤j¤j
³oºô¶¦³Ó´«¦æ
§Ú¦h¥[¤F
varVar = Replace(varVar, Chr(10), " ") '¨ú¥N´«¦æ¬°ªÅ®æ
¤å¦rÀɤºÁÙ¦³1 Ӷ®æ
½Ð°Ý¤j¤j¬O¨º¸Ì¦³¿ù
ÁÂÁÂ- Sub Test()
- GetDividend ("2002")
- '¨ú±oºô¶ªí®æ®æ¦¡¤Æ¬°¤å¦rªí®æ
- End Sub
- Private Sub GetDividend(ByVal ss As String) '¨úªÑ§Qºô¶
- Set ie = CreateObject("internetexplorer.application") '¨Ï¥Î¦¹¤è¦¡¥i¥H§K°£ "³]©w¤Þ¥Î¶µ¥Ø"
- Dim hh As String, T As Date, i, ii, S As Object
- Dim filename As String, varVar As String
- T = Time
- ' hh = "http://dj.mybank.com.tw/z/zc/zcc/zcc_" & ss & ".asp.htm"
- hh = "http://yamstock.megatime.com.tw/asp/stockinfo/GetReport.asp?select_table=html\Finain_Full\&stockid=" & ss & "&name1=D5&index1=5"
- With ie
- .Navigate hh
- Do While .readyState <> 4 'µ¥«Ýºô¶¤U¸ü§¹²¦
- DoEvents
- If Time >= T + #12:00:03 AM# Then 'µ¥«Ý8¬í 3¬í¤Ó¤Ö·|»~¿ù§ï8§®
- DoEvents
- Application.SendKeys "~" 'ªÑ²¼¥N¸¹¿ù»~,ºô¶·|¦³°T®§,¶·«ö½T©w,¤~¥iÄ~Äò¤U±ªÑ²¼¥N¸¹
- Exit Do
- End If
- Loop
- ''***¤£¬Oµ¥«Ý8¬í 3¬í¤Ó¤Ö·|»~¿ù§ï8§® ***
- Do
- Set S = .Document.getElementsByTagName("table")(4) '
- Loop Until Not S Is Nothing
- '*** ³Ó¤@ ¨S®»¨ì ????
- '*** ¦]µ{¦¡¹B¦æ¤Ó§Ö , S Is Nothing, S ©|¥¼«ü©w¬°.Document.getElementsByTagName("table")(4)
- '*** µ{¦¡¤w¸g°õ¦æ¤U¤@¦æ, With ¤u§@ªí2 ªºµ{¦¡½X
- filename = ss & "_" & Format(Now(), "yyyymmddhhmmss") & ".txt"
- Open filename For Output As #1
- For i = 0 To S.Rows.Length - 1 '¼g¤J¸ê®Æ
- varVar = ""
- For ii = 0 To S.Rows(i).Cells.Length - 1 ' S.Rows(i).Cells.Length - 1 ¤~¬O¥¿½T
- varVar = varVar & Left(S.Rows(i).Cells(ii).innerText & Space(14), 14 - (LenB(StrConv(S.Rows(i).Cells(ii).innerText, vbFromUnicode)) - Len(S.Rows(i).Cells(ii).innerText)))
- 'http://forum.twbts.com/thread-31-1-1.html Len / LenB - ¦r¦êªø«×§PÂ_¤è¦¡ªº±´°Q
- varVar = Replace(varVar, Chr(10), " ")
- DoEvents
- Next
- Print #1, varVar
- Next
- Close #1
- ' MsgBox ("¦sÀɦ¨¥\! ")
- End With
- End Sub
½Æ»s¥N½X |
|