Menu

Login not working

Flicky
2005-03-03
2013-04-26
  • Flicky

    Flicky - 2005-03-03

    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

     
    • Kathy Feller

      Kathy Feller - 2005-03-03

      Are you using Tidy.jar or nekohtml.jar?

      kathy

       
    • Flicky

      Flicky - 2005-03-04

      kathy,
      I am using nekohtml.jar. Have you tried this?? Is this working for you??

      ~Flicky

       
      • Kathy Feller

        Kathy Feller - 2005-03-04

        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

         
    • Flicky

      Flicky - 2005-03-04

      Kathy,
      I am able to login into Yahoo mail but not geocities. Do i need to do something special???

      Flicky

       

Log in to post a comment.

Auth0 Logo