Why Jsoup cannot select td element?

后端 未结 3 1634
执笔经年
执笔经年 2021-01-25 01:21

I have made little test (with Jsoup 1.6.1):

String s = \"\" +Jsoup.parse(\"\").select(\"td\").size();
System.out.println(\"Selected elements         


        
3条回答
  •  醉话见心
    2021-01-25 02:05

    Because Jsoup is a HTML5 compliant parser and you feeded it with invalid HTML. A has to go inside at least a

    .

    int size = Jsoup.parse("
    ").select("td").size(); System.out.println("Selected elements count : " + size);

提交回复
热议问题