none
I can not get DOM object using IE. Why ? RRS feed

  • Question

  • I tried to get DOM object using IE but failed. But in other code I could get successfully.

    I watched IE2.document object but it is empty when accessing yahoo.com

    Why ?

    Sub Search()

    Dim IE2 As Object
    Set IE2 = CreateObject("InternetExplorer.Application")

        IE2.Visible = True
         IE2.navigate "http://yahoo.com"

         k = 1
         Do While IE2.Busy Or IE2.readyState < 4
            DoEvents


        Loop

    end sub
    Monday, July 7, 2014 6:53 PM

All replies

  • Sub PriceSearch()
    Dim elems As IHTMLElementCollection

    Dim IE2 As Object
    Set IE2 = CreateObject("InternetExplorer.Application")
    IE2.Visible = True
    IE2.navigate "http://www.suruga-ya.jp/"

    Do While IE2.Busy Or IE2.readyState < 4
    DoEvents


    Loop


    Dim b As Object

    Set a = IE2.document.getElementsById("price")

    I could not get IE2.document object using  watch expression  IE2 object 

    Tuesday, July 8, 2014 9:30 PM
  • I monitored IE2.document variable.

    When url is "http://www.mixi.jp", I could get Web text using IE2.document.all successfully  , but in other site like "http://www.yahoo.com" I cound not web text using IE2.document.

    Why is that ?

    Wednesday, July 9, 2014 1:01 PM