少于html表格中的实际数据 [英] Less than actual data in html table

查看:65
本文介绍了少于html表格中的实际数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在做

Element tbody = doc.select("td#tab table tbody").first();
System.out.println(tbody.childNodeSize());

在以下网址上.

http://164.100.181.140/fcs/Helpline/NFSA/ReportRegidWise.aspx?val=NSMxODcjUiMwMDEzNzMjMDM3OTg0IzEwMDEwMDMwMDAxMiNCUEwjMDkxODcwMDk0NjE4NDI5MQ%3d%3d

但只能返回 5个tr元素

稍后我尝试查看jsoup返回的内容,它仅显示5个tr元素.

Later I tried to see what jsoup is returning it shows just 5 tr elements.

System.out.println(tbody.html());

JavaScript

Javascript

document.querySelector('td#tab table tbody').childNodes.length

显示623条记录.

Jsoup解析器有问题吗?还是我犯了一些错误?

Is there something wrong with Jsoup parser or I'm making some mistake?

谢谢.

推荐答案

文档以大量编码数据开头.我认为Jsoup在1M之后会截断大小.如果要获取整个文档,可以这样配置:

The document starts with a lot of encoded data. Jsoup truncates the size after 1M I think. If you want to get the whole document you can configure this like so:

String url = "http://164.100.181.140/fcs/Helpline/NFSA/ReportRegidWise.aspx?val=NSMxODcjUiMwMDEzNzMjMDM3OTg0IzEwMDEwMDMwMDAxMiNCUEwjMDkxODcwMDk0NjE4NDI5MQ%3d%3d";
Document doc = Jsoup.connect(url)
                .timeout(10000)
                .maxBodySize(0)  //setting to 0 turns size checking off
                .get();

Element tbodyEl = doc.select("td#tab table tbody").first();
System.out.println(tbodyEl);

这需要更长的时间,但是您可以获得所有信息.

This takes a bit longer, but you get all info.

这篇关于少于html表格中的实际数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆