I'm new with Jsoup and not very expert with HTML. I'm trying to get some data from a table in a website.
If I inspect element (from Chrome) on the table I need, I get:
<table class=" table-main" id="tournamentTable!>
<colgroup>...</colgroup>
<tbody>...</tbody>
</table>
When I run the command
Elements e = doc.select("table.table-main");
and then printed the content of e
, I noted that it takes another table of the page whose class is <table class="table-main top-event">
.
Since in class name class=" table-main"
there is a withespace, I made other attempts, like doc.select("table[class= table-main]");
but this returned me a 0-sized element.
I tried to give a look at HTML code and I noted that there is no table with class name " table-main". Could be this the reason?