简体   繁体   English

登录后进行Jsoup解析

[英]Jsoup Parsing After Login

I would like to parse a web page, however after doing authentication (login into practice), to make the step authentication parameters at the login page, then after I'm going to load it with a webview. 我想解析一个网页,但是在进行身份验证(登录到实践)之后,在登录页面上设置步骤身份验证参数,然后再将其加载到Webview中。 The login works perfectly, once logged in, I would like to parse a page, so I pass the URL of the page you want, but he returns the login page, as if I did not access. 登录名可以正常工作,登录后,我想解析一个页面,因此我传递了所需页面的URL,但是他返回了登录页面,就像我没有访问过一样。

I tried searching everywhere but I did not understand, everyone does it differently, if you can help me I shall be very grateful. 我尝试在任何地方搜索,但我不明白,每个人的做法都不同,如果您能帮助我,我将不胜感激。 Thanks a lot in advance See you soon 在此先多谢一会儿见

String url ="indirizzo"+ MainActivity.codschool.getText().toString()+"&login="+MainActivity.id.getText().toString()+"&password="+MainActivity.pw.getText().toString();
            Connection.Response res = Jsoup
                    .connect("url")

                    .data("login", MainActivity.id.getText().toString())
                    .data("password",MainActivity.pw.getText().toString())
                    .method(Connection.Method.POST)
                    .execute();

            //Keep logged in
            Map<String, String> cookies = res.cookies();

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM