Using JSOUP to Login to ConEd website

后端 未结 2 1703
醉梦人生
醉梦人生 2021-01-22 05:01

I have read extensively about how do this and I have tried a number of different variations, but I can\'t get it to work.

Basically, I just want to login to the ConEdis

相关标签:
2条回答
  • 2021-01-22 05:23

    The answer was painfully simple - the headers with the underscores had 2 underscores, I was only using 1. Doh

    0 讨论(0)
  • 2021-01-22 05:24
    • Open Development tools (press F12).
    • Select Network tab option.
    • Up and left there is a round button. If it's not red, click it. This will record the traffic.
    • Visit the login page. Enter your credentials and login.
    • Check what happens in Development tools. There is a table there, showing all the files that were received.
    • Check the Type column. Search for the row that has the value document. Select it. This will open a new screen.
    • Select Headers and scroll down until you locate the Request Headers. There you will find the request that was made from your browser. You will find there all the values that were send to the server.
    • Search for the parameters you need. Take the values and hardcode them to your code. Use the same user-agent (just in case) and in general try to imitate this request with your code.

    All the steps above are for the Chrome browser.

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