How can I extract a value from an html page in vbscript - I tried MSXML2.DOMDocument

前端 未结 2 1575
太阳男子
太阳男子 2021-01-24 14:49

Below is some code I tried to get the value from a node in webpage. But it fails when trying to set the objNode... any help gratefully appreciated.

Dim objHttp,          


        
2条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-24 14:50

    Use the Internet Explorer COM object:

    url = "http://www.hl.co.uk/shares/shares-search-results/a/aveva-group-plc-ordinary-3.555p"
    
    Set ie = CreateObject("InternetExplorer.Application")
    ie.Visible = True
    ie.Navigate url
    While ie.ReadyState <> 4
      WScript.Sleep 100
    Wend
    
    MsgBox ie.document.getElementById("ls-bid-AVV-L").innerText
    
    ie.Quit
    

提交回复
热议问题