开发者

HTML parsing using java [duplicate]

This question already has answers here: Closed 12 years ago.

Possible Duplicate:

Possible to parse a HTML document and build a DOM tree(java)

Hi, We use to parse the xml using DOM, SAX or JDOM. Is there any way to parse the HTML file.

ex. : main_file.html

< div class="Main_Class" id = "main_id" style="width="100%;height="100%">

  < div class="sub_class" **id = "sub_id_one"** style="width="50%;height="100%"> </div>
  < div class="sub_class" **id = "sub_id_two"** style="width="50%;height="100%"> </div>开发者_如何学编程; 

< /div

file_two.html

< div style="position: relative; float: left; width: 24%; height: 100%;>

< input type="button" class="button" value="4"/>

< /div

I want to parse the main file, get the sub_id and then append the the file_two.html on the basis of relativ id.


I would recommend you to use the HTML Cleaner:

http://htmlcleaner.sourceforge.net/

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜