HTML table to java object -


i need convert html table java object. cant find method implementing task. example of table below:

<table id='table'>   <tr>     <th>name</th>     <th>address</th>   </tr>   <tr>     <td>       <a href=''>name1</a>     </td>     <td>       <a href=''>address</a>     </td>   </tr>  </table> 

also expect map table next object:

public class myclass {     public string name;     public string address; } 

i thankfull if task.

i think in case want use jsoup, nice java library parsing web pages. once have parsed data want wepage using jsoup's selectors creating java object should non-trivial. here few helpful links:

file input = new file("table.html");

document doc = jsoup.parse(input, "utf-8", "http://somewebsite.com/");  elements row1name = doc.select("tr");   elements row1address = doc.select("tr");  myclass table1 = new myclass(row1name, row1address); 

something (the selectors row1name , address wrong, have @ docs verify proper way it...i don't remember). hope helps.


Comments

Popular posts from this blog

How has firefox/gecko HTML+CSS rendering changed in version 38? -

android - CollapsingToolbarLayout: position the ExpandedText programmatically -

Listeners to visualise results of load test in JMeter -