- ©«¤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
|
¥»©«³Ì«á¥Ñ singo1232001 ©ó 2023-7-20 11:05 ½s¿è
¦^´_ 1# t8899
Sub ttt()
Set driver = CreateObject("Selenium.ChromeDriver")
driver.get "https://tw.stock.yahoo.com/quote/2330"
driver.Wait 1000
Set ID_0 = driver.findelementbyID("qsp-overview-realtime-info")
Set ID_0_ul_S = ID_0.findelementsbytag("ul")
Set ID_0_ul_S_1_li_S = ID_0_ul_S(1).findelementsbytag("li")
For i = 1 To ID_0_ul_S_1_li_S.Count
Set x = ID_0_ul_S_1_li_S(i).findelementsbytag("span")
If x(1).Text Like "*º¦¶^*" Then
Select Case True
Case x(2).Attribute("class") Like "*C($c-trend-up)*": tx = "¡¶ " & x(2).Text
Case x(2).Attribute("class") Like "*C($c-trend-down)*": tx = "¡¿ " & x(2).Text
Case Else: tx = x(2).Text
End Select
Debug.Print x(1).Text & " " & tx
Else
Debug.Print x(1).Text & " " & x(2).Text
End If
Next
Stop
End Sub |
|