Sign in to follow this  
Followers 0
BlackDistrib

Declare variables after _IENavigate?

3 posts in this topic

#1 ·  Posted

I am trying to get some variables of _IEGetObjById in the new _IENavigate URL and not the initial URL. Putting them after the first section of script seems to work as far as the variables go but the function stops running before performing the remaining script, after the injected variables.

I am a beginner to AutoIT. I am trying to make a interesting bot between pages. Included is the code.

Global $iOE = _IECreate ("https://sample.com/")
    Local $username = _IEGetObjByName($iOE,"log")
    Local $pass = _IEGetObjByName($iOE,"pwd")
    Local $button = _IEGetObjByName ($iOE,"wp-submit")

    _IEFormElementSetValue ($username, "user1")
    _IEFormElementSetValue ($pass, "pass1")
    _IEAction ($button, "click")
    _IELoadWait ($iOE)
    _IENavigate ($iOE, "https://sample.com/sample")

    ;New variables because of new URL
    Local $title = _IEGetObjById ($iOE, "title")
    Local $switch = _IEGetObjById ($iOE, "content-html")
    Local $content = _IEGetObjById ($iOE, "content")
    Local $save = _IEGetObjById ($iOE, "save-post")
    Local $host = _IEBodyReadHTML ($iOE)
    Local $hostchg = $host.ResponseText()
    Local $logout = _IEGetObjById ($iOE,"wp-admin-logout")

    _IEFormElementSetValue ($title, "Snowballs")
    _IEAction ($switch, "click")
    _IEFormElementSetValue ($content, "Take a step back and weep my children!")
    Sleep(5000)
    _IEAction ($save, "click")

 

Share this post


Link to post
Share on other sites



#2 ·  Posted

Nevermind! Placing another function and a call fixed it.

Share this post


Link to post
Share on other sites

#3 ·  Posted

Glad you got it working. For future reference, I didn't respond to your earlier post because it was unclear to me what wasn't working correctly. Next time, post the results from the Scite output window so that we can see any errors, feedback, etc.

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