Logging in to google using python?

后端 未结 4 535
清酒与你
清酒与你 2020-12-13 11:19

I am fairly new to web programing but for the sake of it, I am trying to login to google account not using standard code but as a python application, but it is impossible to

4条回答
  •  隐瞒了意图╮
    2020-12-13 11:43

    Although probably not exactly what you were looking for here I found some code from a similar post that did run from me.

    
    import urllib2

    def get_unread_msgs(user, passwd): auth_handler = urllib2.HTTPBasicAuthHandler() auth_handler.add_password( realm='New mail feed', uri='https://mail.google.com', user='%s@gmail.com' % user, passwd=passwd ) opener = urllib2.build_opener(auth_handler) urllib2.install_opener(opener) feed = urllib2.urlopen('https://mail.google.com/mail/feed/atom') return feed.read()

    print get_unread_msgs("put-username-here","put-password-here")

    reference:
    How to auto log into gmail atom feed with Python?

提交回复
热议问题