返回列表 上一主題 發帖

[發問] 如何下載網頁價量明細

本帖最後由 quickfixer 於 2020-6-16 04:39 編輯

回復 2# PKKO

GBKEE大,5/10在這裡有回答過,2篇文章也才差10天
http://forum.twbts.com/thread-22543-1-1.html
  1. Sub Ex()
  2.     Dim R As Integer, C As Integer
  3.    
  4.     With CreateObject("InternetExplorer.Application")
  5.        .Visible = True
  6.         .Navigate "https://pchome.megatime.com.tw/stock/sto0/ock3/sid1216.html"
  7.         Do While .Busy Or .ReadyState <> 4: DoEvents: Loop
  8.         With .Document.all.tags("table")(2)
  9.             For R = 0 To .Rows.Length - 1
  10.                 For C = 0 To .Rows(R).Cells.Length - 1
  11.                     ActiveSheet.Cells(R + 1, C + 1) = .Rows(R).Cells(C).innerText
  12.                 Next
  13.             Next
  14.         End With
  15.         .Quit
  16.       End With
  17. End Sub
複製代碼
https://www.mobile01.com/topicdetail.php?f=511&t=4737630
對速度有要求不要錯過01這篇,非常快
#797有pchome的code

TOP

        靜思自在 : 有智慧才能分辨善惡邪正;有謙虛才能建立美滿人生。
返回列表 上一主題