简体   繁体   English

Google 错误 - 无法登录,尝试使用 Python selenium 登录时

[英]Google Error - Log-in not possible, when trying to log in with Python selenium

log-in not possible (windows error)无法登录(Windows 错误)

How can i avoid this problem.我怎样才能避免这个问题。

Whenever i try to log in on any google page it´s giving me this error, that i can´t log in and the browser might be not save.每当我尝试登录任何谷歌页面时,它都会给我这个错误,我无法登录并且浏览器可能无法保存。

Thx for your help谢谢你的帮助

I suggest you retrieve cookies from your usual browser and add it to selenium browser to fake your session. Retrieve cookies from your browser as a JSON (with driver.get_cookie() or plug-in EditThisCookie )我建议你从你常用的浏览器中检索 cookies 并将其添加到 selenium 浏览器以伪造你的 session。从你的浏览器中检索 cookies 作为 JSON(使用 driver.get_cookie() 或插件EditThisCookie

Then add cookies to your browser with the method:然后使用以下方法将 cookies 添加到您的浏览器:

with open("your_cookies.json", "r") as f:
     cookie_json = json.load(f)
driver.add_cookie(cookie_json)

Instead of directly logging in to Google, you can do this through another service.您可以通过其他服务代替直接登录 Google。 For example, when you log in with google from here, google will not block you.例如,当您从此处使用 google 登录时,google 不会阻止您。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM