Login with Jsoup Java

后端 未结 1 1733
天涯浪人
天涯浪人 2020-12-21 13:10

How to login via jsoup?

  
相关标签:
1条回答
  • 2020-12-21 13:47

    Usually login into a web site requires two steps -

    1. You send a GET request to get the page, and you extract from there some values like session ID etc, and the cookies.
    2. You send a POST request with the values from step 1, and your user name and password.

    To know which values you need to send, use your browser in the developer mode (by pressing F12) and examine the traffic. Change the user agent string to match your browser, since some sites send different pages to different clients. You can see an example here.

    0 讨论(0)
提交回复
热议问题