作者qaz0955qaz (qaz0955qaz)
看板Visual_Basic
标题[VBA ]请教 VBA 连接 IE 抓取资料
时间Wed Jun 30 00:55:05 2021
请教一下,底下的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
谢谢
--
※ 发信站: 批踢踢实业坊(ptt.cc), 来自: 39.11.103.176 (台湾)
※ 文章网址: https://webptt.com/cn.aspx?n=bbs/Visual_Basic/M.1624985707.A.EFE.html
1F:推 waiter337: wait now 那段改成 07/04 14:27
2F:→ waiter337: Do While .Busy Or .ReadyState <> 4: DoEvents: Loop 07/04 14:27
3F:→ waiter337: 然後 07/04 14:27
4F:→ waiter337: Text = oIE.Document.getElementById("vParagraph").in 07/04 14:28
5F:→ waiter337: nertext 07/04 14:28
6F:→ waiter337: 然後就到end with了 07/04 14:29
7F:→ waiter337: 然後 oIE.Quit 07/04 14:29
8F:→ waiter337: set oIE = Nothing 07/04 14:30
9F:→ waiter337: END SUB 07/04 14:30