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 8833783
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T08:51:51+00:00 2026-06-14T08:51:51+00:00

I want to access a webpage programmatically and extract some information from it. I

  • 0

I want to access a webpage programmatically and extract some information from it.

I want to log in to some website through Java code and make the server feel that the request is actually coming from a real browser.

I am almost there albeit one problem: the website requires a parameter - "sessid" to be passed with to be passed with every request which keeps on changing with every request.

For e.g when I first access the page the sessid=90334 and at the next page its like sessid=78204.

Therefore the url I pass should contain the value of sessid otherwise the authentication fails: www.somesite.com/somepage.php?sessid=75749.

The webpage contains one <input> tag which holds the value of sessid and i have to retrieve the value of that tag.

How can i do that? The tag is like this:

<input type="hidden" name="sessid" value="69529">

I am able to read the whole webpage successfully using the following code:

   BufferedReader rd = new BufferedReader(new InputStreamReader(conn.getInputStream()));

    StringBuilder response = new StringBuilder();
    String line;
    while ((line = rd.readLine()) != null) {
        response.append(line);
    }
  • 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-06-14T08:51:52+00:00Added an answer on June 14, 2026 at 8:51 am

    You can use indexOf method of StringBuilder class:

        String startInputFragment = "<input type=\"hidden\" name=\"sessid\" value=\"";
        int startIdx = response.indexOf(startInputFragment);
        if (startIdx >= 0) {
            int endIdx = response.indexOf("\">", startIdx);
            String val = response.substring(startIdx + startInputFragment.length(),
                    endIdx);
            System.out.println("-->" + val + "<--");
        } else {
            //tag not found: you may throw an ex or do something else
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a server from which I can access a webpage. I want to
The problem: I want to scrap some data from certain webpage (I have administrative
I am developing an android project.i want to access some portion of a webpage
I want to access the following path on Ubuntu in my python code: ~/.mozilla/firefox/dh4ytbdj.default/bookmarkbackups
I want to Access Information of Builds of Team Projects to use them in
I want to access java script's return value , which in is in a
I want to access a static variable from a static method: #!/usr/bin/env python class
i want to access a integer and a string from a class to all
I want to send an email straight from my webpage, but I don't have
I have a webpage that I only want a specific group to log into.

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.