Androidhttpclient & Jsoup Analytic square Educational system

Source: Internet
Author: User

This period of time to learn to use Jsoup to parse the Web page, but also looked at the next school of the square educational system, because this square educational system of all kinds of discomfort, do not know why or so many schools with this system? Every class or something dies. Just like our little birds. O (╯-╰) o

Using androidhttpclient instead of using httpclient, how to say Androidhttpclient is also in the SDK, based on Httpconnection, so the performance should be better.

Because unfamiliar with the use of this powerful tool led to a lot of detours, wasted a lot of time, many parameters are not as simple as new one defaulthttpclient, androidhttpclient parameters need to manually set up a bit, for example, I in Java The project is using httpclient, I did not set any parameters, directly to use, it has helped us to deal with a lot of details, such as redirection, sometimes I do not know what he redirected to do, often not get the content I need. In Android engineering, Using Androidhttpclient is not automatically redirected by default, requires manual setup, and forgetting to set each header causes a variety of problems.

The task is to use Androidhttpclient to obtain the data content of the specified site, including requests to simulate various post,get. And then to the Jsoup tool to resolve the content I need, such as schedule query, user information, student performance, etc...

Of course, before the capture of the Web site analysis is not rare, I used the simplest tools, Google Browser and its own tools, pay special attention to this paragraph in the middle of a string (24-bit), do not understand the principle, this site how to grasp also can't catch cookies,

1. The first login into the line, we know that the general site will be set up a verification code or something, so I think of various ways to try whether you can directly do not verify the code login, but too difficult to engage, or honestly fill it yourself, it seems that what ORC can automatically identify similar verification code.

According to this code address to find links, http://jwgl.hstc.edu.cn/(oco15si4snyeb04510vu0045)/checkcode.aspx, direct access to this is the verification code, But we especially need to get to the middle of the string, it is randomly generated each time, very much like the work of a cookie, the subsequent access will need this paragraph,

At first I was directly fixed a 24-bit string to him, also can normally log in, but access to all kinds of information can not be. So you have to redirect to a new address after you access the http://jwgl.hstc.edu.cn/CheckCode.aspx address. There is a 24-bit string in the middle of the address. Then, based on this string to join the first page to simulate landing. Use Androidhttpclient to get a response to this URL, redirect to a inputstream, and then show it to ImageView, I often do not receive the response of the input stream during the test, there may be a problem, the 2.3 system running is normal, in 4.2 is often no content.

Then it is the process of entering the login for various users.

The code is not affixed, put on the connection, the project is currently underway, welcome you to come to guide.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.