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

  • Home
  • SEARCH
  • 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 9231967
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T06:12:03+00:00 2026-06-18T06:12:03+00:00

I need some help in extracting the sub strings from the table from the

  • 0

I need some help in extracting the sub strings from the table from the link (http://www.informatik.uni-trier.de/~ley/pers/hd/k/Kumar:G=_Praveen.htm)..

I need to extract ONLY the names of the authors and store it into a 2D array..
For example:

a[0][0]= G. Praveen kumar
a[0][1]= Anirban Sakar.
a[1][0]= G. Praveen Kumar,
a[1][1]= Arjun Kumar Murmu,
a[1][2]= Biswas Parajuli ,
a[1][3]= Prasenjit Choudhury

and so on for the next row (till the end of the table)…
the code which i tried is given below..

I need to extract the names of the authors (substring) and store in a 2D array ,as the names are separated by commas and : followed by the name of the article..
I do not want the name of the article to be stored in the 2D array but only the names of person while the end of table.

Any help would be appreciated. Thanks in advance.

package codetrial;
import java.io.*;
import java.lang.String.*;
import org.jsoup.*;
import org.jsoup.nodes.*;
import java.io.BufferedWriter.*;
import java.io.FileWriter.*;
import java.io.IOException.*;
import java.util.*;
import org.apache.commons.lang.StringUtils;

public class Main {
    public static void main(String[] args) {
        try{
            String a;
            final String url="http://www.informatik.unitrier.de/~ley/pers/hd/k/Kumar:G=_Praveen.html";              
            Document doc = Jsoup.connect(url).get();
            for(Element element : doc.select("table div.data") ) {
                a = element.text();
                String[] names = a.split(", "); // comma and space
                String name_one = StringUtils.substringBetween(url, " ", ",");
                String name_two = StringUtils.substringBetween(url, ",", ":");
                System.out.println("person1 = " + name_one);
                System.out.println("person2 = " +name_two);
                for(String name : names) {
                    System.out.println(name);        
                }
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
  • 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-18T06:12:04+00:00Added an answer on June 18, 2026 at 6:12 am

    You can use Jsoup library to do this. See my example:

    import java.util.ArrayList;
    import java.util.List;
    
    import org.jsoup.Jsoup;
    import org.jsoup.nodes.Document;
    import org.jsoup.nodes.Element;
    import org.jsoup.select.Elements;
    
    public class SourceCodeProgram {
    
        public static void main(String[] args) throws Exception {
            System.out.println(PageParser.readAuthors("http://www.informatik.uni-trier.de/~ley/pers/hd/k/Kumar:G=_Praveen.htm"));
        }
    }
    
    class PageParser {
        public static List<List<String>> readAuthors(String url) throws Exception {
            Document document = Jsoup.connect(url).get();
            Elements elements = document.getElementsByClass("data");
            List<List<String>> result = new ArrayList<List<String>>();
            List<String> authors = new ArrayList<String>();
            for (Element element : elements) {
                for (Element child : element.children()) {
                    if ("title".equals(child.className())) {
                        result.add(authors);
                        authors = new ArrayList<String>();
                        break;
                    }
                    authors.add(child.html());
                }
            }
            return result;
        }
    }
    

    Output:

    [[G. Praveen Kumar, Anirban Sarkar], [G. Praveen Kumar, Arjun Kumar Murmu, Biswas Parajuli, Prasenjit Choudhury], [G. Praveen Kumar, Anirban Sarkar, Narayan C. Debnath]]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Need some help from javascript gurus. I have one page where http://www.google.com/finance/converter is embedded
I`m new to JavaScript and I need some help extracting the ID from URL
i need some help to parse a html, extracting everything starting with http://, containing
Need some help with extracting 2 pieces of information from the following string: viewed
I am very new to perl and need some help with extracting a table
I need some help extracting the following bits of information using regular expressions. Here
Need some help from Oracle app developers out there: I have an C#.NET 4.0
Need some help from a MySQL expert here. I have a terrible database to
Need Some Help With Regex: I want to replace [url=http://youtube.com]YouTube.com[/url] with <a href=http://youtube.com>YouTube.com</a> the
Need some help understanding what the difference between these two redirects is: header( HTTP/1.1

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.