Jump to content

Wait until text is visible


Recommended Posts

Hey all,

 

I'm trying to build a simple comment poster, but I'm stuck at this; I'd like for script to wait until a text "Comment submitted" is visible on page, then sleep.

Here is my poor code for this func so far:

$sText = _IEBodyReadText($oIE) ; or this? --> $sText = _IEPropertyGet("innerText")
    If $sText="The text you're looking for" Then
        sleep(1000)
    EndIf

Help, pls:)

Thanks!

Link to comment
Share on other sites

Link to comment
Share on other sites

im not  familiar with IE func, did a quick look in the help file for IE, based from helpfile and script from above, I came up with this:

#include <IE.au3>
#include <MsgBoxConstants.au3>
Global $var = "user forum", $counter = 1
Global $oIE = _IE_Example("basic")
Sample()


Sleep(1000)

Global $var = "HTML"
Global $oIE = _IE_Example("basic")
Sample()

Func Sample()

    Do
        $sText = _IEBodyReadText($oIE) ; or this? --> $sText = _IEPropertyGet("innerText")
    Until StringInStr($sText, $var)

    _IEQuit($oIE)
    If $counter = 1 Then
        MsgBox($MB_OK, "", $counter & "st" & @CRLF & $var)
    Else
        MsgBox($MB_OK, "", $counter & "nd" & @CRLF & $var)
    EndIf

    $counter += 1
EndFunc   ;==>Sample

:sweating:

ill get to that... i still need to learn and understand a lot of codes graduated.gif

Correct answer, learn to walk before you take on that marathon.

Link to comment
Share on other sites

weird, its working in my side, I changed the value in 1st $var so the script will wait for the text in 1st $var and run the script,  while the script is active I changed the value in IE Browser and 1st msgbox poped up...

 

how about showing some reproducer??? :lol:

Edited by 232showtime

ill get to that... i still need to learn and understand a lot of codes graduated.gif

Correct answer, learn to walk before you take on that marathon.

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