crawler4j - 我无法得到标题

时间:2015-07-08 13:34:19

标签: crawler4j html-title

简而言之:我无法获得此网址的标题http://www.namlihipermarketleri.com.tr/default.asp?git=9&urun=10277(现已破坏(2015年11月18日))

我的WebCrawler实现:

StreamRtsp

注意:标题本身包含一些逗号“,”。 你能建议一个解决方案吗? 这是一个错误吗?

提前致谢。

1 个答案:

答案 0 :(得分:2)

问题可能是HTML文档中有4个标题标记。

我使用过Jsoup:http://jsoup.org/

HtmlParseData htmlParseData = (HtmlParseData) page
                        .getParseData();
String html = htmlParseData.getHtml();
Document htmlDocument = Jsoup.parse(html);              
String title = htmlDocument.getElementsByTag("title").get(0).text();