Best DOM API for Java for HTML -
what dom api java when need work html documents retrieve using code httpurlconnection. noticed jsoup except being dom parser can http connecting. there better or more suitable more complicated http requests?
in 2 sentences, answer be: (a) don't mix network connections dom parsing in application design. (b) jsoup go.
some more details follow:
(a) can not recommend mixing 2 requirements (1) dom parsing , (2) handling http connections. of course, don't know situation @ hand, end unclear design difficult maintain. instance, if ever migrate https, depend on parser being able handle it.
(b) said, if working html documents, more interested in being able deal not valid xhtml, incomplete markup.
there have been other, related questions on stackoverflow (e.g. this or this), boil down tools for:
- cleaning html pages conform xhtml,
- dom parsing,
- a combination of both.
the used tools seem be
here list of open source java html parsers, convenience.
if still feel parser should handle url connections, maybe can specify more details on mean "more complicated http requests"?
hth
Comments
Post a Comment