Jump to content

Need some help with Strings


souleke
 Share

Recommended Posts

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)

Link to comment
Share on other sites

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
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...