Python,网络浏览器和Gmail [英] Python, Webbrowser and Gmail

查看:73
本文介绍了Python,网络浏览器和Gmail的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

朋友们.我想打开Gmail但使用一个特定的帐户.我的python脚本有一个gmail帐户列表,我希望该帐户以已被单击/选中的gmail打开.我尝试使用URL中的凭据,但对此感到不满意,因为我不想将用户密码放入URL中,这是行不通的:).

Hey friends. I want to open Gmail but with a particular account. My python script has a list of gmail accounts and i want the one to open in gmail which has been clicked/selected. I tried using the credentials in the URL but am not happy with that as I don't want to put the users password in the URL + it doesn't work :).

我正在使用webbrowser.open(URL)打开gmail.

I'm using webbrowser.open(URL) to open gmail.

解决方案?

推荐答案

我不知道 是否可行,但是值得一试.

I have no clue if this would work, but it may be worth a shot.

您可以尝试欺骗浏览器并通过urllib登录并获取 cookie.然后您可以以编程方式将cookie放入浏览器的cookie目录中,然后将浏览器启动到gmail.

You could try to spoof the browser and login via urllib and grab the cookie. Then you could programatically put the cookie in the browsers cookie directory and launch the browser to gmail.

如果您可以让浏览器+ Google相信该cookie是有效的,则似乎可行,但是有可能.

It seems like it would work if you can get the browser+google to believe the cookie is a valid one, but it may be possible.

这篇关于Python,网络浏览器和Gmail的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆