如何用vba抓取网页数据?
Subcc() Cells.ClearContents SetoDoc=CreateObject("htmlfile") WithCreateObject("WinHttp.WinHttpRequest.5.1") .Open"GET", "", False .Send .WaitForResponse oDoc.body.innerHTML=.responsetext Setr=oDoc.All.tags("table")(7).Rows Fori=0Tor.Length-1 k=[a65536].End(3).Row Forj=0Tor(i).Cells.Length-1 Cells(k+1,j+1)=r(i).Cells(j).innerText Nextj Nexti Setr=Nothing EndWith EndSub
Copyright © 广州京杭网络科技有限公司 2005-2025 版权所有 粤ICP备16019765号
广州京杭网络科技有限公司 版权所有