Re: Applescript (using do javascript) to log in to a password protected webpage is failing on the button-click step
Re: Applescript (using do javascript) to log in to a password protected webpage is failing on the button-click step
- Subject: Re: Applescript (using do javascript) to log in to a password protected webpage is failing on the button-click step
- From: Deivy Petrescu <email@hidden>
- Date: Mon, 23 May 2016 15:11:17 -0400
William, this is my kind of error: document.getElementById not document.getElementByID (check the last ādā)
> On May 23, 2016, at 14:48 , William Dockery <email@hidden> wrote:
>
> set ASURL to "https://campsself.active.com/MiddleburyInteractiveLanguages"
> set ASusername to "a"
> set ASpassword to "b"
>
>
> tell application "Safari"
> open location ASURL
> end tell
>
> delay 5
>
> inputByID("apl-username", ASusername)
> inputByID("apl-password", ASpassword)
>
> delay 3
>
> clickthebutton("apl-btn-login")
>
> to inputByID(theId, theValue)
> tell application "Safari"
> do JavaScript " document.getElementById('" & theId & "').value ='" & theValue & "';" in document 1
> end tell -- stops using safari
> end inputByID --marks the end of the function
> to clickthebutton(theId)
> tell application "Safari"
> do JavaScript " document.getElementByID('" & theId & "').click();" in document 1
> end tell
> end clickthebutton
>
>
> Script events:
>
> tell application "Safari"
> open location "https://campsself.active.com/MiddleburyInteractiveLanguages"
> do JavaScript " document.getElementById('apl-username').value ='a';" in document 1
> do JavaScript " document.getElementById('apl-password').value ='b';" in document 1
> do JavaScript " document.getElementByID('apl-btn-login').click();" in document 1
> end tell
>
>
Deivy Petrescu
email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden