- ©«¤l
- 354
- ¥DÃD
- 5
- ºëµØ
- 0
- ¿n¤À
- 387
- ÂI¦W
- 0
- §@·~¨t²Î
- windows7
- ³nÅ骩¥»
- vba,vb,excel2007
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2017-1-8
- ³Ì«áµn¿ý
- 2024-8-2
|
¦^´_ 31# singo1232001
§ó¥¿¤@¤U(³æ¦C ¸ò Âù¦C)
Sub test()
Set DRIVER = CreateObject("Selenium.ChromeDriver")
DRIVER.Get "https://tw.stock.yahoo.com/quote/1101.TW"
Cells.ClearContents
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 |
|