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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T06:51:04+00:00 2026-05-21T06:51:04+00:00

I am looking to write a Java app which queries multiple URLs (defined by

  • 0

I am looking to write a Java app which queries multiple URLs (defined by a list of URIs) for their HTML source and returns the contents of a specific element with a defined id on each page.

As an example, lets say one started with a list of a list of blog post URLs such as…

  • http://www.myblog.com/post_three
  • http://www.myblog.com/post_two

…now, if a sample page looks like the following…

<html>
<body>
    <div class="content">
        <h2 id="post_title">Post Title</h2>
        <p class="post_paragraph">Here is the content of my post.</p>
    </div>
</body>
</html>

How can I grab the contents of the “post_title” id for each of my URLs, and print it to the console with the classic System.out.print(String s)?

Thanks for all input.

  • 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-21T06:51:05+00:00Added an answer on May 21, 2026 at 6:51 am

    First you resolve the URL using Java’s connection API

    http://download.oracle.com/javase/6/docs/api/java/net/URLConnection.html

    Then you will need to parse the HTML

    http://www.google.be/search?q=java+html+parser

    And finally you will need to walk the parsed document structure (that will depend on the parser you choose) to find an element with the given id.

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

Sidebar

Related Questions

I'm looking to write a html sanitiser, and obviously to test/prove that it works
Looking for C# class which wraps calls to do the following: read and write
I'm looking for a 3D graphics library for a Java web app. Could use
How can I write caller location information (Java source file and line), in a
I'm looking to write a small client-server-based text game that handles multiple client connections
I'm looking for effective approach to writing Java web app in Vaadin. (several pages,
I'm looking to write a java program that has the following requirements: An ability
Iam looking to write a C# application to alert the user when he gets
I am looking to write some C# code for linux/windows/mac/any other platform, and am
I'm looking to write a small proxy server for kicks and giggles. Apart from

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.