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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T16:55:31+00:00 2026-06-16T16:55:31+00:00

so I am grabbing a BIG list of elements using JSoup from a page.

  • 0

so I am grabbing a BIG list of elements using JSoup from a page. When I say big, I mean like a few hundred elements. I know that the elements are there because I converted them all to one huge string and they were all listed. Now what I need to do is put them into an array so I can process them 1 by 1. Here is my current code:

    public static String [] grabWordList(String ending) throws IOException, InterruptedException{

Document doc = Jsoup.connect("http://site.com/").get();
Elements links = doc.getElementsByClass("defLink"); //Get words from site
String s[] = new String[links.size()]; //Create an array

int i = 0;
for(Element el : links){  //Attempt to put them into an array using this loop of blindly coppy and pasted code (I know, HORRIBLE Idea, I dont usually do that, but I am lost)
    s[i++] = el.attr("links");
}
 return s;
    }

When I do this, I use this code to attempt to grab the array and print it:

String words[] = Methods.grabWordList("in");

   for(int j=0; j < words.length; j++){
       System.out.println(words[j]);
   }

When running this code, all that prints is [Ljava.lang.String;@6201dbc
Im hoping that someone can help. 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-06-16T16:55:33+00:00Added an answer on June 16, 2026 at 4:55 pm

    I personally think, “String words[]” words should be defined as “String []”, like in Java creating an array.but I’m not too skilled for JSoup.

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

Sidebar

Related Questions

I am grabbing a node from XML that returns the date like this :
I'm grabbing a string from the database that could be something like String’s Title
I am grabbing some data from a page using the code below: int clientId
Grabbing delimited dates from database and adding new ones to the list, then want
I'm grabbing a list of events from a database and am trying to associate
I'm grabbing lines from a text file and sifting line by line using regular
I'm grabbing a row from the the db in a wordpress plugin using: $ongoing_event
I'm having some problem's grabbing a response stream from a request that returning status
I have jquery grabbing an id from something else (image) and I would like
I am grabbing posts from the WordPress database using this piece of code: $query

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.