import requests
with requests.Session() as c:
url = "https://www.roblox.com/newlogin"
UserName = input("Your username is > ")
PassWord = input("Your password is > ")
c.get(url)
login_data = dict(username = UserName, password = PassWord, next='/')
r = c.post(url, data=login_data, headers={"Referer":"https://www.roblox.com/newlogin"})
if r.headers.status_code == 302:
print("Successfully logged in")
else:
print("Invalid username or password")
这是我的代码,它应该检查用户名和密码是否正确,出于某种原因,当我输入真实密码和真实用户名时,它仍会打印("Invalid username or password")
,我该怎么办?< / p>