bfuchs
asked on
Looking for script to auto open site with credentials filled in.
Hi Experts,
I would like to have a script/function that opens the following site
https://pages.caspio.com/login/bridgelogin/default.aspx?_ga=2.157757818.1116850724.1518037460-1462101065.1512014265
fills in the account, username and password.
See attached.
Should either be done thru Access VBA or via script.
Thanks in advance.
Untitled.png
I would like to have a script/function that opens the following site
https://pages.caspio.com/login/bridgelogin/default.aspx?_ga=2.157757818.1116850724.1518037460-1462101065.1512014265
fills in the account, username and password.
See attached.
Should either be done thru Access VBA or via script.
Thanks in advance.
Untitled.png
ASKER
Hi Rastoi,
First thanks for the work.
Was not at work yet.
Will soon test it & reply.
Thanks,
Ben
First thanks for the work.
Was not at work yet.
Will soon test it & reply.
Thanks,
Ben
ASKER
Hi,
I saved as .ps1, then opened with notepad and put the credentials.
Now when run as powershell nothing happens.
Thanks,
Ben
I saved as .ps1, then opened with notepad and put the credentials.
Now when run as powershell nothing happens.
Thanks,
Ben
Hi Ben,
How are you running it? In console?
Really nothing no error, no message, just ends?
How are you running it? In console?
Really nothing no error, no message, just ends?
ASKER
By right click, choose run as powershell.
Not really familiar with powershell..
A black screen pops up but closes after a few sec..
Thanks,
Ben
Not really familiar with powershell..
A black screen pops up but closes after a few sec..
Thanks,
Ben
Please, open powershell console i.e. start/run: powershell
Start saved script by using full path to file, and put result here together with informatio which version of operating system ate you using.
In my timezone is 1pm now, so I will check in about 8 hours.
Start saved script by using full path to file, and put result here together with informatio which version of operating system ate you using.
In my timezone is 1pm now, so I will check in about 8 hours.
ASKER
ASKER
Actually I got that above fixed.
Now it did tried to connect but got the attached errors.
Thanks,
Ben
Untitled.png
Now it did tried to connect but got the attached errors.
Thanks,
Ben
Untitled.png
ASKER
Hi,
OK I realized that guess during this weekend they changed somehow their login screen.
Currently this is how it looks
https://id.caspio.com/?_ga=2.154520880.944330641.1518404630-2087572457.1512014159
See attached.
Note- Instead of AccountID user name and password, they now require email and password.
Perhaps we just need to modify your code accordingly..
Thanks,
Ben
Untitled.png
OK I realized that guess during this weekend they changed somehow their login screen.
Currently this is how it looks
https://id.caspio.com/?_ga=2.154520880.944330641.1518404630-2087572457.1512014159
See attached.
Note- Instead of AccountID user name and password, they now require email and password.
Perhaps we just need to modify your code accordingly..
Thanks,
Ben
Untitled.png
ASKER
Did try updating as follows.
Thanks,
Ben
Untitled.png
$login='***'
$user='MyEmail'
$password='MyPwd'
Add-Type -AssemblyName System.Windows.Forms
Add-Type @"
using System;
using System.Runtime.InteropServices;
public class StartActivateProgramClass {[DllImport("user32.dll")][return: MarshalAs(UnmanagedType.Bool)] public static extern bool SetForegroundWindow(IntPtr hWnd);}
"@
$ie = New-Object -ComObject InternetExplorer.Application
Do {Start-Sleep 1} Until (!($IE.Busy))
$ie.Navigate('https://pages.caspio.com/login/bridgelogin/default.aspx?_ga=2.154520880.944330641.1518404630-2087572457.1512014159')
Do {Start-Sleep 5} Until (!($IE.Busy))
$ie.Visible=$true
[void] [StartActivateProgramClass]::SetForegroundWindow($ie.HWND)
($ie.Document.getElementsByTagName('a')|? {$_.classname -eq 'AdvancedUserLink'}).click()
([System.__ComObject].InvokeMember('getElementById',[System.Reflection.BindingFlags]::InvokeMethod,$null,$ie.document,'email')).value=$user
([System.__ComObject].InvokeMember('getElementById',[System.Reflection.BindingFlags]::InvokeMethod,$null,$ie.document,'Password')).value=$password
([System.__ComObject].InvokeMember('getElementById',[System.Reflection.BindingFlags]::InvokeMethod,$null,$ie.document,'Email')).focus()
[System.Windows.Forms.SendKeys]::SendWait(" {BS}")
([System.__ComObject].InvokeMember('getElementById',[System.Reflection.BindingFlags]::InvokeMethod,$null,$ie.document,'Password')).focus()
[System.Windows.Forms.SendKeys]::SendWait(" {BS}{Enter}")
exit
Got the attached.Thanks,
Ben
Untitled.png
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER
Thanks very much rastoi!
btw, I'm planning to have a few such requests in near future, will post a link here..
just wondering, are you also familiar with Access VBA?
btw, I'm planning to have a few such requests in near future, will post a link here..
just wondering, are you also familiar with Access VBA?
Open in new window
of course, for real life I would save encrypted password into file and decode only for login (using powershell securestring, but it is for another question ;-)
Small small trouble can occure, if you (or some other application) change the focus during logon, but password is protected from displaying on such event.