HTML data extract in Java

前端 未结 3 1621
小鲜肉
小鲜肉 2021-01-23 16:11

I have HTML code similar to :

1    
Value 1

2             


        
3条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-23 16:47

    Assuming the html is well formed, you can parse the html using HtmlUnit.

    You could also write you own regular expression to process the page if there is just a single table but I would highly recommend against this as regular expressions might give strange results if the page added additional tables whereas with HtmlUnit you could validate that the page has only a single table before you start to parse or just target the table you wish.

提交回复
热议问题