我需要一个python脚本,提示输入用户名和密码,并尝试登录到Hotmail使用这些凭证,输出他们是否有效。
发布于 2010-07-15 07:39:32
Hotmail登录!
import poplib
M = poplib.POP3_SSL('pop3.live.com', 995) #Connect to hotmail pop3 server
try:
M.user(raw_input("username: ")) #Get the username from the standar input
M.pass_(raw_input("password: ")) #Get the password from the standar input
except:
print "username or password incorrect"
else:
print "Successful login"编辑:因为您只需要知道是否可以登录,所以我重写了代码
如果你在输入用户名或密码的过程中失去了连接,我不知道会发生什么。
发布于 2015-07-06 16:04:45
如果pop3失败,这是另一种选择。只需使用python outlook库检查使用IMAP for hotmail、live或now only outlook.com的登录,您可以在此处下载:https://github.com/awangga/outlook
import outlook
mail = outlook.Outlook()
mail.checkLogin()它将尝试用户名和密码进行身份验证。
https://stackoverflow.com/questions/3251237
复制相似问题