https://github.com/ngminhhoang1412/logingmailselenium
This is a small package to log in to Google account with Selenium. After signin, Chrome profile of that user will be create and stored. With Chrome profile you can do so many automatic things with it.
https://github.com/ngminhhoang1412/logingmailselenium
gmail login selenium-webdriver
Last synced: about 1 year ago
JSON representation
This is a small package to log in to Google account with Selenium. After signin, Chrome profile of that user will be create and stored. With Chrome profile you can do so many automatic things with it.
- Host: GitHub
- URL: https://github.com/ngminhhoang1412/logingmailselenium
- Owner: ngminhhoang1412
- License: mit
- Created: 2022-11-16T04:41:30.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-06-27T11:35:37.000Z (almost 3 years ago)
- Last Synced: 2025-04-19T10:39:05.594Z (about 1 year ago)
- Topics: gmail, login, selenium-webdriver
- Language: Python
- Homepage:
- Size: 5.39 MB
- Stars: 18
- Watchers: 1
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# **Google login with Selenium**
## Overview
This is a small package to log in to Google account with Selenium. After signin,
Chrome profile of that user will be create and stored. With Chrome profile you can do so many automatic things
with it.
Always active extension is installed by default.
To store the profile with minimum size on disk, WorkerService cache, OptimizationGuide and cache is cleared when quitting driver.
>This has been developed for testing purposes only.
> Any action you take using this script is strictly at your own risk.
> I will not be liable for any losses or damages you face using this script.
## Requirement
Must have Python <= 3.9 and Google Chrome installed.
## Usage
```pycon
pip install login_gmail_selenium
```
And then on example.py
```pycon
from login_gmail_selenium.util.profiles.profile import GoogleProfile
from login_gmail_selenium.util.profiles.google_profile import Profile
profile = GoogleProfile(email, password, backup_email)
# profile = Profile(name_profile) If don't need login to google but save driver
# To allow downloads add insecure=True to ChromeProfile
# To handle false email with custom functions, use param false_email_callback
driver = profile.retrieve_driver()
profile.start()
# Do whatever with driver afterward
driver.get('https://www.google.com/')
driver.quit()
...
```
1. Add folder extension/ if you want custom extensions for Chrome (.crx or .zip)
2. The temp folder's content will be generated by the library.
Your folder should look like this
```cvs
/temp
/profiles
/profile1
/profile2
/blank_profiles
/blank_profiles1
/blank_profiles2
/extension
/custom_extension
extension1.zip
extension2.crx
example.py
```
## License
Copyright © 2022 [MoliGroup](https://moligroup.co/), [MIT license](./LICENSE).
For an improvement or a bug please feel free to open a PR
For work information please contact ngminhhoang1412@gmail.com or
[LinkedIn](https://www.linkedin.com/in/ho%C3%A0ng-nguy%E1%BB%85n-1b13481b7/).