ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

[µo°Ý] ½Ð±Ð³oºô­¶ªþ¹Ïªí®æ¬O¦b²Ä´X???(table)

¥»©«³Ì«á¥Ñ GBKEE ©ó 2020-5-10 15:20 ½s¿è

¦^´_ 3# t8899

  1. Option Explicit
  2. Sub Ex()
  3.     Dim R As Integer, C As Integer
  4.     With New InternetExplorer  '**³]©w¤Þ¥Î¶µ¥Ø¥[¤J-->   Microsoft Internet Controls***
  5.        .Visible = True
  6.         .Navigate "https://pchome.megatime.com.tw/rank/sto0/ock03.html"
  7.         Do While .Busy Or .ReadyState <> 4: DoEvents: Loop
  8.                      '<table style="margin-top: 10px;" cellspacing="1" cellpadding="0" **ºô­¶ªº¤º®e**
  9.          With .Document.querySelector("table[style='margin-top: 10px;'][cellspacing='1'][cellpadding='0']")
  10.          '' With .Document.all.tags("table")(0) '** ¤]¥i¥H
  11.             For R = 0 To .Rows.Length - 1
  12.                 For C = 0 To .Rows(R).Cells.Length - 1
  13.                     ActiveSheet.Cells(R + 1, C + 1) = .Rows(R).Cells(C).innerText
  14.                 Next
  15.             Next
  16.         End With
  17.          .Quit
  18.       End With
  19. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

        ÀR«ä¦Û¦b : §g¤l¥ß«í§Ó¡A¤p¤H«í¥ß§Ó¡C
ªð¦^¦Cªí ¤W¤@¥DÃD