• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Applescript (using do javascript) to log in to a password protected webpage is failing on the button-click step
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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: William Dockery <email@hidden>
  • Date: Mon, 23 May 2016 14:26:08 -0500

And that’s my kind of answer!  Thanks so much--


On May 23, 2016, at 2:11 PM, Deivy Petrescu <email@hidden> wrote:

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

References: 
 >Applescript (using do javascript) to log in to a password protected webpage is failing on the button-click step (From: William Dockery <email@hidden>)
 >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>)

  • Prev by Date: Re: Applescript (using do javascript) to log in to a password protected webpage is failing on the button-click step
  • Next by Date: Re: Reload Library?
  • Previous by thread: Re: Applescript (using do javascript) to log in to a password protected webpage is failing on the button-click step
  • Next by thread: functions as sort of first class objects
  • Index(es):
    • Date
    • Thread