Jump to content
Sign in to follow this  
BlackDistrib

Declare variables after _IENavigate?

Recommended Posts

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

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  

×
×
  • Create New...