Jump to content

Recommended Posts

Posted

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!

Posted

Sorry, just figured out that the script mustn't sleep, until text is visible, but Wait for the text.

So something similar to my code above, but working one:)

Any ideas?

 

Thanks!

Posted (edited)

remove sleep...

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.

Posted

It would be better, if I could use the Wait function somehow, instead of Sleep. This one is bugging me, 'cause I don't know how to make it wait until the text is found, not sleep. Ugh...

Help, pls? Thanks!

Posted

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.

Posted

232showtime, thanks but not working:)

It has to be a simple way to wait until the text is visible on page. Just wait for it, and when it's there, sleep 1000 then close.

Anyone? Thanks!

Posted (edited)

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.

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
  • Recently Browsing   0 members

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