• 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: 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


  • Follow-Ups:
    • 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>
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>)

  • Prev by Date: Applescript (using do javascript) to log in to a password protected webpage is failing on the button-click step
  • Next by Date: Re: Applescript (using do javascript) to log in to a password protected webpage is failing on the button-click step
  • Previous by thread: Applescript (using do javascript) to log in to a password protected webpage is failing on the button-click step
  • Next by thread: Re: Applescript (using do javascript) to log in to a password protected webpage is failing on the button-click step
  • Index(es):
    • Date
    • Thread