Sign in to follow this  
Followers 0
souleke

Need some help with Strings

3 posts in this topic

hey

I'm trying to find a text in a frame of IE but if thats not true it needs to go on to the next frame and click the button so it go's to the next page

clicking the button and so isn't the problem but finding the text in the frame seems to be hard :/

i have used some snippets and stuff i find on the forum here but stil i'm stuck and getting the same error

Func Findit()
    $frame = _IEFrameGetObjByName($oIE, "frm2" )
    $sHTML = _IEBodyReadText ($frame)
    If StringInStr($sHTML, "MEMBER ONLINE" ) Then 
        Return True
    EndIf
EndFunc

the error it gives

Return SetError($_IEStatus_Success, 0, $o_object.document.body.innerText)

Return SetError($_IEStatus_Success, 0, $o_object.document^ ERROR

if i remove the "findit" func the script runs fine and keeps doing its work

so the problem sits in this func

please help

i need this because if i change stuf of the site while the member is on, he/she gets booted or i get errors and then i have mutch more to fix :x

(Note: sry for my english but i'm dutch)

Share this post


Link to post
Share on other sites



Can you post your script, it will be more easy to find the error ! Posted Image


AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

after 2 days i found it !!!

the string had "enter" in it so i had to strip it first

first code

Func Findit()
    $frame = _IEFrameGetObjByName($oIE, "frm2" )
    $sHTML = _IEBodyReadText ($frame)
    If StringInStr($sHTML, "MEMBER ONLINE" ) Then 
        Return True
    EndIf
EndFunc

the working 1

Func Findit()
    $frame = _IEFrameGetObjByName($oIE, "frm2" )
    $sHTML = _IEBodyReadText ($frame)
    $var = StringReplace($sHTML, @CRLF, " ") ; strip the string from "enter" 
    If StringInStr($var, "MEMBER ONLINE" ) Then 
        Return True
    EndIf
EndFunc

topic solved :x

edit: typo in code

Edited by souleke

Share this post


Link to post
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
Sign in to follow this  
Followers 0