I have an html table with an ID of thetable. It has (according to FireBug), an unnamed TBODY tag, and an unnamed TR tag. The three TD tags inside that I want to access are unnamed. Is there any CSS selector that I can use to reference these unnamed tr tags?
I’ve tried:
table#thetable:nth-child(1)
But this does not select for those tags.
I’m using jsoup.org to pull this data into strings. I’d like to take the text of each TD in the table (of which I know the name) and put all that into an array.
Something like this:
// Pseudocode for all the TDs into an array
Elements strings = doc.select("table#thetable: children");
If you’re simply looking to get all your
tdelements, this should be enough:Then iterate
elems, retrieve the text from yourtds and put them in your array.Also, you should probably use an array list instead of an array if you don’t know or can’t control how many cells your table will have: