Login to website using python

前端 未结 2 2297
深忆病人
深忆病人 2020-11-30 00:34

I am trying to login to this page using Python.

I tried using the steps described on this other Stack Overflow post, and got the following code:

impo         


        
2条回答
  •  长情又很酷
    2020-11-30 01:16

    The term "login" is unfortunately very vague. The code given here obviously tried to log in using HTTP basic authentication. I'd wager a guess that this site wants you to send it a username and password in some kind of POST form (that's how most web-based login forms work). In this case, you'd need to send the proper POST request, and keep whatever cookies it sent back to you for future requests. Unfortunately I don't know what this would be, it depends on the site. You'll need to figure out how it normally logs a user in and try to follow that pattern.

提交回复
热议问题