Menu

parsing table with links

Help
2004-09-14
2004-09-14
  • Marek Nazarko

    Marek Nazarko - 2004-09-14

    I'm parsing sth. like eBay (list of products).
    It's simple table, some columns has also links.
    I'm able to look at table using
    Node nodes [] = parser.extractAllNodesThatAre(TableTag.class);
    and visiting TableColumn[] and then nodes via getChildrenAsNodeArray()
    I can read every text I need, but there is no links at all (because they are not TableTag.class i think).
    How should i parse this table to have text _and_ links at once?

    It's example of my table, i need to extract: id,name,link and price.
    <table name=xx>
    <tr>
    <th>id</th>
    <th>name with link</th>
    <th>price</th>
    </tr>
    <tr>
    <td>12243</td>
    <td><a href="someadress">name1</a></td>
    <td>123$</td>
    </tr>
    <tr>
    <td>1323</td>
    <td><a href="someadress2">name2</a></td>
    <td>145$</td>
    </tr>
    </table>

     
    • Marek Nazarko

      Marek Nazarko - 2004-09-14

      ok, I did it via enumarating
      cell.getChildren().searchFor(LinkTag.class, true)
      Very nice :)

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.