首页 > 解决方案 > 如何在没有驱动器 API 的情况下使用 selenium 和 python 登录谷歌驱动器

问题描述

所以我试图通过网络解析登录谷歌驱动,它似乎不允许脚本直接登录驱动。有没有办法在不使用 Drive API的情况下克服这个问题。这样做的可能方法是什么?有什么方法可以从 chrome 中隐藏我正在使用脚本的事实吗?

from webbot import Browser

web = Browser()
#Go to google drive's Login
web.go_to('https://accounts.google.com/signin/v2/identifier?service=wise&passive=true&continue=http%3A%2F%2Fdrive.google.com%2F%3Futm_source%3Dar&utm_medium=button&utm_campaign=web&utm_content=gotodrive&usp=gtd&ltmpl=drive&hl=en&flowName=GlifWebSignIn&flowEntry=ServiceLogin')
web.click(id='identifierId')
web.type('EMAILID')
web.click('Next', tag='span')
web.click(id='password')
web.type('PASSWRD')
web.click('Next', tag='span')

exit()

标签: pythonauthenticationselenium-webdriveroauthautomated-tests

解决方案


更安全的帐户不允许,但不太安全的帐户只需要在登录后进行一些授权


推荐阅读