简体   繁体   中英

Python Google authentication for a program used for web scraping

Never done this but, I'm trying to build a program, that would scrape a google classroom site specific to the user that's logged in. Even when logged in the main browser google denies the request and instead gives me authentication error (I need to login in other words) how can I be logged in, in the program so that google accepts my request and grants me to scrape classroom sites.

Tried this solution but without luck: Logging into Google using Python

It was published a while ago and google could have changed the requirements for these kind of program authentication.

What I desire is to get into the section only available for me when I'm logged in, eg content of my classroom and grab some text from it, is it even possible?

It would be expensive to try and implement a log-in mechanism, especially with all the 2FA requirements of Google solutions today.

What would be quicker and usually works in software automation today is to have a manually logged in session and then start the browser with the user data directory pointed to it. This is how it's usually achieved and the relogin is done manually from time to time, only when needed. More info on how to set up a user data directory here .

This gets you up and running pretty fast.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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