- ©«¤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 ©ó 2022-11-19 21:17 ½s¿è
¦^´_ 1# DanielWONG
Sub test2()
Set chrome = CreateObject("selenium.chromedriver")
chrome.get "https://www.hangseng.com/en-hk/personal/insurance-mpf/e-mpf/fund-price-performance/"
chrome.Wait 1000
Set A_s = chrome.FindElementsBytag("a")
For i = 1100 To A_s.Count
If A_s(i).Text = "Acknowledge" Then A_s(i).Click: Exit For
Next
ReDim ar(1 To 1000, 1 To 1)
Set td_s = chrome.FindElementsBytag("td")
For Each Z In td_s
If Z.attribute("headers") = "price_header1" Then w = w + 1: ar(w, 1) = Z.Text
Next
Cells.ClearContents
Cells(1, 1).Resize(w, 1) = ar
End Sub |
|