Lately I have been using httpunit to do some automated programming on Yahoo. I have written a program to login and check Yahoo mail . following is the code...
This code works fine.
Now if I change the URL from http://mail.yahoo.com
to http://geocities.yahoo.com, I keep on getting the login page again. Has anyone tried such thing or faced any problem like this before??
help me......
Thanks
Flicky
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
Lately I have been using httpunit to do some automated programming on Yahoo. I have written a program to login and check Yahoo mail . following is the code...
----------------------------
WebConversation wc = new WebConversation();
WebRequest request = new PostMethodWebRequest( "http://mail.yahoo.com" );
WebResponse response = wc.getResponse( request );
WebForm form = response.getFormWithName("login_form");
form.setParameter("login","<<yuor userid here>>");
form.setParameter("passwd","<<yuor password here>>");
WebResponse response2 = form.submit();
----------------------------
This code works fine.
Now if I change the URL from http://mail.yahoo.com
to http://geocities.yahoo.com, I keep on getting the login page again. Has anyone tried such thing or faced any problem like this before??
help me......
Thanks
Flicky
Are you using Tidy.jar or nekohtml.jar?
kathy
kathy,
I am using nekohtml.jar. Have you tried this?? Is this working for you??
~Flicky
Didn't have a chance to try it until tonight. I usually login to frames stuff so that's a little different.
However, the following works for me to login to both yahoo and geocities. It's slightly different than yours.
WebConversation wc = new WebConversation();
// Process main page
// WebResponse response = wc.getResponse("http://mail.yahoo.com");
WebResponse response = wc.getResponse("http://geocities.yahoo.com");
// Login
WebForm form = response.getFormWithName("login_form");
form.setParameter("login", "your login");
form.setParameter("passwd", "your password");
response = form.submit();
System.out.println("Title: " + response.getTitle() + ";");
System.out.println(response.getText());
I do the getTitle and the getText when I'm testing to see that I get to the correct page.
Let me know if this works for you.
kathy
Kathy,
I am able to login into Yahoo mail but not geocities. Do i need to do something special???
Flicky