wood burning stoves 2.0*
The moose likes Java in General and the fly likes Using Java to Automatically enter Login, Password and Enter key to start web page XM Pplayer Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Using Java to Automatically enter Login, Password and Enter key to start web page XM Pplayer" Watch "Using Java to Automatically enter Login, Password and Enter key to start web page XM Pplayer" New topic
Author

Using Java to Automatically enter Login, Password and Enter key to start web page XM Pplayer

john Huck
Greenhorn

Joined: Sep 13, 2013
Posts: 2
My quest:
I have an XM/Sirius Internet account and want to record a show that comes on at night when I am asleep.
I can use Task manager to wake my computer and get to the web page that I need and it will also start the program that I use to record (Total Recorder) but what can I use to enter my Login, Password and hit the enter key to start the XM player?
I have only limited experience with Visual basic and no experience with Java but I understand Java is what I Need to accomplish my task. Can anyone help me with my task in a manner that even a novice can understand?

Thanks

John
Steve Luke
Bartender

Joined: Jan 28, 2003
Posts: 4167
    
  21

john Huck wrote:My quest:
I have an XM/Sirius Internet account and want to record a show that comes on at night when I am asleep.
I can use Task manager to wake my computer and get to the web page that I need and it will also start the program that I use to record (Total Recorder) but what can I use to enter my Login, Password and hit the enter key to start the XM player?

You can't automate the keyboard and mouse that way in Java. What you would likely need to do is study the login form to see what URL it submits to and what information it requires to successfully login, then make a post request to the same url providing the correct information. It very well could be a multi-step process, like post to one URL and get a secret token or cookie, then post to the login url to with your username, password, the secret token and cookie. And it might not be so easy to get that info from pages directly anymore, since there is so much use of javascript and dynamic page content the actual data required by the form could be well hidden.

Anywho, you will have to dig it all out and mimic the login process. Before you do that you should check the site's terms of service, though, 'cause of they catch you using a bot to login they could boot your account if it isn't allowed.

I have only limited experience with Visual basic and no experience with Java but I understand Java is what I Need to accomplish my task. Can anyone help me with my task in a manner that even a novice can understand?

There is no special reason you need Java for this. If you are more experience in VB, then you might find it better to use VB rather than learning a new language to do this. If you think you will get code you can copy and paste and be up in a day, you are mistaken - it will take you a lot longer than that to learn what you need to do it in Java. On the other hand if you just want to use this as an application to get you started in learning Java, then awesome - having a target to hit is great. I would start here to begin learning the language: Oracle's Java tutorial then mosey on over to Apache HttpClient to get a library to help with the HTTP comms.


Steve
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

Years ago there used to be applications which you could get which would start other applications and click on buttons in those applications and so on. But it didn't take long before people started using those applications, or rather the APIs used by them, to do all kinds of ill-mannered things like downloading malware without the user's consent. So recent versions of Windows were fixed to basically outlaw that.
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10171
    
    8

Does the site have a "Remember me" or "Keep me logged in" kind of option? I am wondering if you can bypass the login by logging manually and choosing this option. The the recorder application might not need to login.

I can use Task manager to wake my computer and get to the web page that I need and it will also start the program that I use to record (Total Recorder)

Of course this might work if the application uses the same browser you used to login.

[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
 
 
subject: Using Java to Automatically enter Login, Password and Enter key to start web page XM Pplayer
 
Similar Threads
User Authentication and login System in JAVA
Using Java to Automatically enter Login, Password and Enter key to start web page XM Pplayer
JAAS, mixing cofigs ..
Login to a ssl enabled site using encrypted password
Problem in implementing Single Sign on