Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Error: 0x80020006 - Unknown name. when working with IE



  • Please log in to reply
4 replies to this topic
Vrajitoru
  • Members
  • 44 posts
  • Last active: Oct 06 2015 07:31 AM
  • Joined: 16 Mar 2010

Hello All,

 

I came across an error and I don't know how it was possible, considering that the script worked before.

 

Here is the part of the code:

pages = 3
wb := ComObjCreate("InternetExplorer.Application")
wb.Visible := true
wb.Navigate("www.google.com/search?q=" Query)
While wb.readyState != 4 || wb.document.readyState != "complete" || wb.busy ; wait for the page to load
	   sleep 100
loop, % pages+1
    {
    sleep 200
    loop % (Nodes := wb.document.getElementById("rso").childNodes).length
        Links_urls .= Nodes[A_index-1].getElementsByTagName("a")[0].href "`n"
    wb.document.getElementById("pnnext").click()
    While wb.readyState != 4 || wb.document.readyState != "complete" || wb.busy ; wait for the page to load
	   sleep 100
    }
Msgbox %Links_urls%

The variable Query is from a small GUI.

 

Here is the error:


Error:  0x80020006 - Unknown name.

Specifically: 0

    Line#
    092: wb.Navigate("www.google.com/search?q=" Query)  
    093: While,wb.readyState != 4 || wb.document.readyState != "complete" || wb.busy
    094: Sleep,100
    095: Loop,pages+1
    096: {
    097: Sleep,200
    098: Loop,(Nodes := wb.document.getElementById("rso").childNodes).length
--->    099: Links_urls .= Nodes[A_index-1].getElementsByTagName("a")[0].href "
"  
    100: wb.document.getElementById("pnnext").click()  
    101: While,wb.readyState != 4 || wb.document.readyState != "complete" || wb.busy
    102: Sleep,100
    103: }
    104: MsgBox,%Links_urls%
    105: FileAppend,%Links_urls%,Test.txt
    110: foundlinks = 0

Continue running the script?
---------------------------
Yes   No   
---------------------------

 

Can anyone help me understand what happened and how can be fixed?

 

Thank you!

 



HotKeyIt
  • Moderators
  • 7439 posts
  • Last active: Jun 22 2016 09:14 PM
  • Joined: 18 Jun 2008

Seems to work fine for me, e.g.:

Query:="AutoHotkey"
pages = 3
wb := ComObjCreate("InternetExplorer.Application")
wb.Visible := true
wb.Navigate("www.google.com/search?q=" Query)
While wb.readyState != 4 || wb.document.readyState != "complete" || wb.busy ; wait for the page to load
	   sleep 100
loop, % pages+1
    {
    sleep 200
    loop % (Nodes := wb.document.getElementById("rso").childNodes).length
        Links_urls .= Nodes[A_index-1].getElementsByTagName("a")[0].href "`n"
    wb.document.getElementById("pnnext").click()
    While wb.readyState != 4 || wb.document.readyState != "complete" || wb.busy ; wait for the page to load
	   sleep 100
    }
Msgbox %Links_urls%


jethrow
  • Moderators
  • 2854 posts
  • Last active: May 17 2017 01:57 AM
  • Joined: 24 May 2009
✓  Best Answer
Perhaps try
Nodes.item(A_Index-1)


Vrajitoru
  • Members
  • 44 posts
  • Last active: Oct 06 2015 07:31 AM
  • Joined: 16 Mar 2010

The script it worked for me before, but not sure why now it didn't.

 

Thank you, Jethrow, looks like the error is not happening anymore.



mauritius
  • Members
  • 75 posts
  • Last active: Aug 22 2015 09:53 AM
  • Joined: 04 Aug 2010

@jethrow:

thank you from me also! :)


zakupy grupowe na MyDeal.pl