Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/amazon-web-services/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 未使用jsoup从网站获取所有html_Java_Html_Web_Jsoup - Fatal编程技术网

Java 未使用jsoup从网站获取所有html

Java 未使用jsoup从网站获取所有html,java,html,web,jsoup,Java,Html,Web,Jsoup,我知道这类问题很多,但我没有找到答案 所以问题就和主题一样。在开始时,网页要求我输入登录名和密码-登录后,我试图获得完整的html,但相反,我有10-20%的html,其余接收到的数据甚至不知道来自何处(下面的示例) 系统输出打印项次(文件); } 当我尝试在登录之前从网站获取html时,它工作得很好。。。 谢谢你的帮助 “如果内容依赖于javascript,那么jsoup是不够的(没有javascript支持)。如果您使用搜索,您应该阅读使用HtmlUnit的建议。如果没有页面url和登录凭据

我知道这类问题很多,但我没有找到答案

所以问题就和主题一样。在开始时,网页要求我输入登录名和密码-登录后,我试图获得完整的html,但相反,我有10-20%的html,其余接收到的数据甚至不知道来自何处(下面的示例)

系统输出打印项次(文件); }

当我尝试在登录之前从网站获取html时,它工作得很好。。。
谢谢你的帮助

“如果内容依赖于javascript,那么jsoup是不够的(没有javascript支持)。如果您使用搜索,您应该阅读使用HtmlUnit的建议。如果没有页面url和登录凭据,则无法重现问题。”

如果内容依赖于javascript,那么jsoup是不够的(不支持javascript)。如果您使用了搜索,您应该已经阅读了使用HtmlUnit的建议。如果没有页面url和登录凭据,问题将无法重现。感谢您的回复Frederic。
> <script type="text/javascript">
> 
> window.currentUserName="******"; 
> window.currentUserGroups={};
> window.currentUserRoles={};
> 
> window.currentUserGroups['InventoryEditor']=true;
> window.currentUserRoles['InventoryEditor']=true;
> window.currentUserGroups['inventoryScriptBypass']=true;
> window.currentUserRoles['User']=true;
> window.currentUserGroups['rsuser']=true;
> window.currentUserRoles['User']=true;
> 
> 
> window.getCurrentUserName = function() {
>     return window.currentUserName; };
> 
> window.currentUserHasGroup = function(groupName) {
>     return window.currentUserGroups[groupName] ? true : false; };
> 
> window.currentUserHasGroups = function(groupNames) {
>     for (var i = 0; i < groupNames.length; i++) {
>         if (window.currentUserHasGroup(groupNames[i])) {
>             return true;
>         }
>     }
>     return false; };
Connection.Response loginForm = Jsoup.connect("Website before login")
        .method(Connection.Method.GET)
        .execute();

Document document = Jsoup.connect("Website after login")
        //.maxBodySize(0)
        //.timeout(0)
        .data("cookieexists", "false")
        .data("login", "login")
        .data("password", "password")
        .data("submit", "Sign in")
        .cookies(loginForm.cookies())
        .get();