- ©«¤l
- 759
- ¥DÃD
- 249
- ºëµØ
- 0
- ¿n¤À
- 1021
- ÂI¦W
- 0
- §@·~¨t²Î
- windows 11
- ³nÅ骩¥»
- OFFICE2021
- ¾\ŪÅv
- 50
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2011-5-30
- ³Ì«áµn¿ý
- 2024-11-24
|
½Ð±Ð³oºô¶nª½±µ¶×¤J¤u§@ªín¦p¦ó§ï??
https://tw.stock.yahoo.com/d/i/rank.php?t=up&e=tse
Sub test()
Set Ie = CreateObject("InternetExplorer.Application")
Ie.Visible = True
Ie.Navigate "https://tw.stock.yahoo.com/d/i/rank.php?t=up&e=tse"
Do While Ie.Busy Or Ie.ReadyState <> 4: DoEvents: Loop
Dim I As Integer, S As Integer, k As Integer, J As Integer
Dim Element
Set Element = Ie.document.getelementsbytagname("table")
With Sheets("sheet2")
.Range("a1:f30").ClearContents
For S = 2 To 2 '¤w§ä¥Xºô¶ªºtable¤º®e¦b 2 ¤¤
For I = 0 To Element(S).Rows.Length - 1
k = k + 1
For J = 0 To Element(S).Rows(I).Cells.Length - 1 '¸ê®ÆªºÄæ¦ì¦@6¦ì
.Cells(k, J + 1) = Element(S).Rows(I).Cells(J).innerText
Next
Next
Next
End With
Set Element = Nothing
Ie.Quit
End Sub |
|