1

My aim is to use GoogleScript to autologin to a website - for this I have used the following post (incl. the comments that post received) as template:

How to login to an external website with Google Apps Scripts?

I could get it to populate the username ... but password remained empty and login was not triggered - it basically stranded on the login page - not indicating that password had been entered - nor complaining about it being missing.

Then I tried a more simple approach by following this post:

How can I autologin into a website with IE?

-I got the same result - with the test code looking like this:

<!DOCTYPE html>
<head>
</head>
<body>
    <script type="text/javascript">
        BoardURL="https://fantasyfootball.telegraph.co.uk";
        UserName="myusername";
        PassWord="mypassword";
        document.write('<form name="autoLogin" action="'+BoardURL+'/premierleague/log-in/"method="post"><input type="hidden" name="email" value="'+UserName+'"><input type="hidden" name="pass" value="'+PassWord+'">');
        document.forms[0].submit();
    </script>
</body>

I would expect to see both username and password entered on the webpage + a complain about wrong username/password combination (indicating that login had been attempted) ... because of the values "myusername" & "mypassword" being used for the login.

I'm using Chrome.

I have spend a lot of time searching for an answer to why neither approach is working and I have reached the point where I need to turn to some experts that can either tell me what I'm doing wrong or tell me that this is never going to work (due to e.g. security settings on the website). Any feedback on this will be appreciated.

Community
  • 1
  • 1
user2628114
  • 41
  • 1
  • 4
  • Doesn't look like this is related to Apps Script https://developers.google.com/apps-script/ – AshClarke Jan 19 '15 at 22:36
  • Thanks teatimer - I have the same impression since I can get the user name across (in both examples). I'm really surprised that getting the password across and pressing the login button is not possible ... so after having spend additonal hours trying to get this to work I'm throwing in the towel. Hopefully my post can save other people time and headache if they run into the same problems trying to use GAS for autologin. – user2628114 Jan 25 '15 at 14:13

1 Answers1

0

You'd be better off using software like:

Official Website - AutoIt

It can send keystrokes with code if you can use something that runs from your computer and not the internet.

Alan Wells
  • 30,746
  • 15
  • 104
  • 152
  • Thanks Sandy for your comment. I know AutoIt and I must admit that AutoIt beats GAS when it come to autologin. I can't see how I can combine AutoIt with my code in GAS - and I would prefer to keep everything in GAS, because it makes the solution more simple (my need for autologin just recently surfaced ... and currently I'm a bit reluctant to go back to AutoIt because it would require a lot of rework for me). – user2628114 Jan 25 '15 at 14:34