Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6681599
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T04:36:30+00:00 2026-05-26T04:36:30+00:00

I’ve been trying to access a website to parse data for an Android application

  • 0

I’ve been trying to access a website to parse data for an Android application I am developing, but I am having no luck when it comes to logging in.

The website is https://giffgaff.com/mobile/login

And below is a stripped out version of the form from that page (HTML):

<form action="/mobile/login" method="post">
    <input type="hidden" name="login_security_token" value="b22155c7259f402f8e005a771c460670">    
    <input type="hidden" name="redirect" value="/mobile">    
    <input type="hidden" name="p_next_page" value="">    


    <input name="nickname" maxlength="25" type="text" value="" />            
    <input name="password" type="password" value="" />

    <button name="step" type="submit" value="Login">Login</button>
</form>

Can anyone please suggest how I can login to this website using Java then parse the redirected page?

Up to now, I’ve tried processes on the lines of:

public static void main(Context context) {
    try {
        // Construct data
        String data = URLEncoder.encode("nickname", "UTF-8") + "=" + URLEncoder.encode("testingA", "UTF-8");
        data += "&" + URLEncoder.encode("password", "UTF-8") + "=" + URLEncoder.encode("testing", "UTF-8");

        // Send data
        URL url = new URL("https://giffgaff.com/mobile/login");
        URLConnection conn = url.openConnection();
        conn.setDoOutput(true);
        OutputStreamWriter wr = new OutputStreamWriter(conn.getOutputStream());
        wr.write(data);
        wr.flush();

        // Get the response
        BufferedReader rd = new BufferedReader(new InputStreamReader(conn.getInputStream()));
        String str = "";
        String line;
        while ((line = rd.readLine()) != null) {
            str += line;
        }

        AlertDialog alertDialog = new AlertDialog.Builder(context).create();
        alertDialog.setTitle("Output");
        alertDialog.setMessage(str);
        alertDialog.setButton("Okay", new DialogInterface.OnClickListener() {
            public void onClick(DialogInterface dialog, int which) {

            }
        });
        alertDialog.show();

        wr.close();
        rd.close();
    } catch (Exception e) {
        AlertDialog alertDialog = new AlertDialog.Builder(context).create();
        alertDialog.setTitle("ERROR");
        alertDialog.setMessage(e.toString());
        alertDialog.setButton("Okay", new DialogInterface.OnClickListener() {
            public void onClick(DialogInterface dialog, int which) {

            }
        });

        alertDialog.show();
    }
}

But my attempts return the page as if the login information was incorrect.

If you would like to see for yourself how the login page behaves, here’s some test login details:
Nickname (username): testingA
Password: testing
The site also seems to depend on a Cookie called “napaSessionId”

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T04:36:30+00:00Added an answer on May 26, 2026 at 4:36 am

    First a word of caution, if you don’t have direct permission to do this, beware, the site in question may preclude this in their terms of service.

    To answer the question, there are many, many reasons a site would reject a login. To do this successfully you need to get as close as possible to how a browser would handle the transaction. To do that you need to see what a real browser is doing.

    https is more tricky as many http sniffers can’t deal with it but httpwatch claims it can. Check out the HTTP transactions and then try to replicate them.

    Your url.openConnection() call will actually return an instance of HTTPURLConnction, cast to that & then you’ll be able to easily set various http headers such as the User-Agent.

    A final note, you say a cookie may be required. Your code isn’t going to deal with cookies. To do that you’ll need to use a cookie manager, e.g.: http://download.oracle.com/javase/tutorial/networking/cookies/index.html

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a French site that I want to parse, but am running into
I have a jquery bug and I've been looking for hours now, I can't
I want to count how many characters a certain string has in PHP, but
I am trying to understand how to use SyndicationItem to display feed which is
I used javascript for loading a picture on my website depending on which small
Basically, what I'm trying to create is a page of div tags, each has
Seemingly simple, but I cannot find anything relevant on the web. What is the
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.