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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T09:18:32+00:00 2026-05-23T09:18:32+00:00

I want to be able to grab N lines (HTML text content that start

  • 0

I want to be able to grab N lines (HTML text content that start on new lines) on a specific URL e.g. www.sitename.com and store them as strings in an array.

something like

public void grabLines(){

//create instance of class from imported library

//pass sitename into it

//from the instance, call a method for grabbing the lines on the site and pass in "N" as a parameter

//the  method returns an array/list of N Strings that I can access later

}

Is there a native Java library I can import to do this? Does it allow me do what I want easily?

Thanks

  • 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-23T09:18:33+00:00Added an answer on May 23, 2026 at 9:18 am

    Are you trying to make a screen scraper? you will be pulling html as opposed to just what you see. also if the website is dynamic you won’t be able to pull everything that you can see. If you want just html and stuff you can try something like this. I tried to build a bloomberg screen scraper and then parse out the random html tags.

     try {
            URL bbg = new URL("http://www.bloomberg.com/markets/economic-calendar/");
            BufferedReader r =  new BufferedReader(new InputStreamReader( bbg.openStream()));
            while( (temp = r.readLine())!= null){
                System.out.println(temp);
            }
    
        } catch (Exception e){
            e.printStackTrace();
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to be able to grab content from web pages, especially the tags
I want to be able to grab keys/values from a cookie and use that
I want to be able to run netstat -n and grab the output somehow
I want to be able to capture the exception that is thrown when a
I want to be able to do this. MyInterface interface = new ServiceProxyHelper<ProxyType>(); Here's
I have my blog on blog.mydomain.com and I am realizing that I want to
I want to be able to grab the Title of a web page from
I have an iFrame and I want the user to be able to grab
I want to use a select statement to grab specific tuples based on their
I'm using LaTeX and BibTeX for an article, and I want to able to

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.