[VBA ]請教 VBA 連接 IE 抓取資料

作者: qaz0955qaz (qaz0955qaz)   2021-06-30 00:55:05
請教一下,底下的VBA 程式碼如何抓取網頁中的資訊如下
"統一編號:22099131, 登記機關:科技部新竹科學園區管理局 , 登記現況:核准設立
, 地址:新竹科學園區新竹市力行六路8號 , 資料種類:公司 , 核准設立日期:
0760221, 核准變更日期:1100625"
Sub test()
Dim oIE As Object, oNode As Object
Set oIE = CreateObject("InternetExplorer.Application")
With oIE
.Visible = True
.Navigate "https://findbiz.nat.gov.tw/fts/query/QueryBar/queryInit.do"
Do While .Busy Or .ReadyState <> 4: DoEvents: Loop
.document.all("qryCond").Value = "台灣積體電路"
.document.getElementById("qryBtn").Click
Application.Wait Now + TimeValue("00:00:05")
End With
End Sub
謝謝
作者: waiter337 (給開司一罐蘇格登)   2021-07-04 14:27:00
wait now 那段改成Do While .Busy Or .ReadyState <> 4: DoEvents: Loop然後Text = oIE.Document.getElementById("vParagraph").innertext然後就到end with了然後 oIE.Quitset oIE = NothingEND SUB

Links booklink

Contact Us: admin [ a t ] ucptt.com