Skip to main content

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.

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

pip install login_gmail_selenium

And then on example.py

from login_gmail_selenium.util.profile import ChromeProfile

profile = login(email, password, backup_email)
driver = profile.retrieve_driver()
profile.start()
# Do whatever with driver afterward
driver.get('https://www.google.com/')
...

Add folder extension/ if you want custom extensions for Chrome (.crx or .zip). Your folder should look like this

/temp
    /profiles
      /profile1
      /profile2
/extension
    extension1.zip
    extension2.crx
example.py

Upload to pypi

  1. Organize your code into proper file hierarchy
  2. Add a LICENSE and a README.md if not already done
/demopackage
    __init__.py
    demopackage.py
    /demosubpackage
      __init__.py
      demosubpackage.py
    /tests
        test_package.py
LICENSE
setup.py
  1. Create your setup.py
import setuptools

with open("README.md", "r") as fh:
    long_description = fh.read()

setuptools.setup(
    name="login_gmail_selenium",
    version="0.0.1",
    author="Minh Hoang",
    author_email="nguyenthanhdungktm@gmail.com",
    description="A python package for login google by selenium",
    long_description=long_description,
    long_description_content_type="text/markdown",
    url="https://github.com/ngminhhoang1412/LoginGmailSelenium",
    packages=setuptools.find_packages(),
    classifiers=(
        "Programming Language :: Python :: 3.9",
        "Operating System :: OS Independent",
        "License :: OSI Approved :: MIT License"
    ),
)
  1. Create distribution archive files

Before you begin, run the following command to update required packages:

pip install --upgrade setuptools wheel
python setup.py sdist bdist_wheel

This should create a dist/ folder in your main directory with the compressed files for your package! 5. Upload your distribution archives to PyPI

pip install --upgrade twine
twine upload dist/*

You will be prompted for your PyPI login credentials, and then the upload will begin. Now you should be able to log in to your PyPI account and see your package.

License

Copyright © 2022 MoliGroup, MIT licensed.

Metadata

Release files for login-gmail-selenium 0.0.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for login-gmail-selenium 0.0.6
File Size Uploaded Provenance Actions
login_gmail_selenium-0.0.6.tar.gz 47.3 kB Without provenance Details for login_gmail_selenium-0.0.6.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for login-gmail-selenium 0.0.6
File Interpreter ABI Platform Actions
login_gmail_selenium-0.0.6-py3-none-any.whl Python 3 none any Details for login_gmail_selenium-0.0.6-py3-none-any.whl

Total release size: 93.4 kB

Release files / login_gmail_selenium-0.0.6.tar.gz

Download URL login_gmail_selenium-0.0.6.tar.gz
Size 47.3 kB
Tags Source
SHA-256 checksum
How to use checksums
63fed3e57ce2a6403e1d1368cf8a7b66f0575e64f30ffc37622336e8d0834682
BLAKE2b-256 checksum
How to use checksums
a41965a10cdf5be8220c44ab20180d1208a1033d5fe40714dfb08046e3b37a68
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.0

Release files / login_gmail_selenium-0.0.6-py3-none-any.whl

Download URL login_gmail_selenium-0.0.6-py3-none-any.whl
Size 46.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
24d3e12afbd481a78085bc3180ea5a309076fb02964a06027d3984a3dbf1bbc3
BLAKE2b-256 checksum
How to use checksums
a1095faceb253fbf2ffb5f0db382bf580b40defe8539569fdd18b5f33153daac
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.0

Security for login-gmail-selenium 0.0.6

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.6 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page