Jump to content

Error in my code


 Share

Recommended Posts

Func _GuiButtonClicked()
    Local $aRecords
    _FileReadToArray("words.txt", $aRecords); reads my word list into array. Only one word in one line.



    Local $oImgs = _IEImgGetCollection($oIE)    ;there is images in web browser where Ineed to find my word in their src
    Local $iNumImg = @extended
    

    For $oImg In $oImgs ;Starts first image



;checking
        For $x = 1 To $aRecords[0]   ;starts loop where it tries to find any word in img.src  from my word list array.

            If StringInStr($oImg.src, $aRecords[$x])  Then  
                _IEAction($oImg, "click")      ;if word from wordlist found in src then clicks that img.
                Sleep(1000)
            EndIf

        Next ;go to check for other word
;checking



    Next   ;go to next image


EndFunc   ;==> _GuiButtonClicked

I dont know what is wrong here.

For first found img is okay but when it tries to search for second match it shows me:

--> COM Error Encountered in WordTest.au3
----> $IEComErrorScriptline = 76                               ; line    If StringInStr($oImg.src, $aRecords[$x])  Then
----> $IEComErrorNumberHex = 80070005
----> $IEComErrorNumber = -2147024891
----> $IEComErrorWinDescription = 
----> $IEComErrorDescription = 
----> $IEComErrorSource = 
----> $IEComErrorHelpFile = 
----> $IEComErrorHelpContext = 7471223
----> $IEComErrorLastDllError = 0
Edited by AntiFros
Link to comment
Share on other sites

  • Developers

Are you trying to find a literal string in an Image?

Jos

Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

I get images src which looks like "imgs/loveus.jpg" and my word list looks

Jonhson
Love
Plain
Facebook

So I try to find one of these words in $oImg.src   (imgs/loveus.jpg). If found then do something if not then go to next img.src

Edited by AntiFros
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...