- ©«¤l
- 522
- ¥DÃD
- 55
- ºëµØ
- 0
- ¿n¤À
- 599
- ÂI¦W
- 60
- §@·~¨t²Î
- win 10
- ³nÅ骩¥»
- []
- ¾\ŪÅv
- 50
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2013-3-19
- ³Ì«áµn¿ý
- 2025-3-13
           
|
¦^´_ 52# singo1232001
¦A½Ð±Ð ¤j¤j¡A ¤U¤@µ{¦¡¦p¦ó¶ñ¥[¥\¯à¨ú±o "¸ê®Æ®É¶¡ : 2023/08/21 10:44"¡A ÁÂÁÂ
http://forum.twbts.com/viewthread.php?tid=23777&page=4
Sub Test()
Dim Driver As New Selenium.ChromeDriver
Dim ID0 As Object, UL1
Dim sp, u2%, ar(), i%, w%
Dim sh As Worksheet
Cells.ClearContents
Set Driver = CreateObject("Selenium.ChromeDriver")
If Driver Is Nothing Then opDriver
Driver.AddArgument ("headless") '¤£Åã¥ÜWebPage
' Driver.Start
Driver.Get "https://tw.stock.yahoo.com/quote/1101.TW"
Set ID0 = Driver.FindElementByID("qsp-overview-realtime-info")
Set UL1 = ID0.FindElementsByTag("ul")(1)
'³æ¦C
sp = Split(UL1.text, Chr(10))
Cells(1, 1).Resize(UBound(sp) + 1, 1) = Application.Transpose(sp)
'Âù¦C
u2 = UBound(sp) / 2
ReDim ar(1 To u2, 1 To 2)
For i = 0 To UBound(sp) Step 2
w = w + 1
ar(w, 1) = sp(i)
ar(w, 2) = sp(i + 1)
Next
Cells(1, 3).Resize(UBound(ar), 2) = ar
End Sub |
|