如何通过python请求登录Google?

时间:2016-08-18 17:41:05

标签: python http post get python-requests

我正在使用Python请求创建API,并且HTTP GET工作正常,但我在使用HTTP POST方面遇到了一些麻烦。因此,与许多网站一样,您可以阅读信息,但是为了发布帖子请求(例如关注用户或撰写帖子),您需要进行经过身份验证的会话。这个网站,使用谷歌登录。通常,我只是将用户名:密码传递到POST请求formdata登录,但这个谷歌的事情非常不稳定(坦率地说,我不是那么有经验)。有没有人有参考或示例来帮助我? ; /

1 个答案:

答案 0 :(得分:-2)

我不知道python请求,但发送电子邮件就像这个

一样简单
import yagmail
yagmail.SMTP(emailh).send(email, subject, body)

#emailh = your email (just username no @gmail.com)
#email = send to (full email including domain ***@gmail.com or ***@outlook.com)
#subject = subject of the message
#body = body of the message

更好

    emailh = raw_input('Your email: ')
    email = raw_input('Send to: ')
    subject = raw_input('Subject: ')
    body = raw_input('Body: ')
    yagmail.SMTP(emailh).send(email, subject, body)
    print('Email Sent.')

如果这就是你所说的话。

此页面可能有用link

相关问题