Skip to main content

Introduction

The Python Selenium Google Form package is used to automate the completion of Google Forms. This package uses the Google Chrome browser.

GitHub: https://github.com/bot-anica/python_selenium_google_form
PyPI: https://pypi.org/project/python-selenium-google-form/

Installing

If you have pip on your system, you can simply install or upgrade the Python bindings:

    pip install python-selenium-google-form

Alternately, you can download the source distribution from PyPI https://pypi.org/project/python-selenium-google-form/#files, unarchive it, and run:

    python setup.py install

Using

To use this package you should create Selenium driver and navigate to target Google Form. You can do it like me. I have 2 useful functions to simplify it:

import undetected_chromedriver as uc

def get_driver(options: list) -> uc.Chrome:
    """
    Creating driver with settings
    :param options: uc.ChromeOptions
    :return: uc.Chrome
    """

    if options:
        driver_options: uc.ChromeOptions = uc.ChromeOptions()

        for option in options:
            driver_options.add_argument(option)

        return uc.Chrome(options=driver_options)

    else:
        return uc.Chrome()


def get_page(url: str, driver: uc.Chrome) -> None:
    """
    Loading page
    :param url: str
    :param driver: uc.Chrome
    :return: None
    """

    driver.get(url)

Using these functions and current package you can automate the completion of Google Forms. For example:

from time import sleep
from typing import List

from python_selenium_google_form import process_form_fields_with_hotkeys, FieldConfig, FieldType

from selenium_methods import get_driver, get_page

WEB_DRIVER_OPTIONS = ["--start-maximized", "--disable-popup-blocking"]


def main() -> None:
    driver = get_driver(WEB_DRIVER_OPTIONS)
    driver.implicitly_wait(10)

    get_page(
        "https://docs.google.com/forms/d/e/1FAIpQLSfP0lcoj1XrdXtKCSwSkCaPEgGaGkY267U6yLCH3WkIz-58vg/viewform",
        driver)

    fields_list: List[FieldConfig] = [
        FieldConfig("first_name", FieldType.TEXT, "John"),
        FieldConfig("last_name", FieldType.TEXT, "Doe"),
        FieldConfig("job_title", FieldType.TEXT, "Software Developer"),
        FieldConfig("education_level", FieldType.RADIO, [1, 0, 0]),  # 1 means that field is selected, 0 - not selected
        FieldConfig("favourite_subjects", FieldType.CHECKBOX, [0, 0, 1, 1, 0]),  # 1 means that field is selected, 0 - not selected
        FieldConfig("experience", FieldType.SELECT, [0, 0, 1, 0]),  # 1 means that field is selected, 0 - not selected
        FieldConfig("date", FieldType.DATE, "01-09-2022"),
    ]

    process_form_fields_with_hotkeys(fields_list, driver)

    sleep(10)


main()

Metadata

Release files for python-selenium-google-form 0.7.2

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

Source distribution (sdist)

Source distribution for python-selenium-google-form 0.7.2
File Size Uploaded Provenance
python_selenium_google_form-0.7.2.tar.gz 3.5 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for python-selenium-google-form 0.7.2
File Interpreter ABI Platform
python_selenium_google_form-0.7.2-py3-none-any.whl Python 3 none any Details

Total release size: 7.7 kB

Release files / python_selenium_google_form-0.7.2.tar.gz

Download URL python_selenium_google_form-0.7.2.tar.gz
Size 3.5 kB
Tags Source
SHA-256 checksum
How to use checksums
a6935d055aa3e30e305d2dd27d98f48993815f29e36c6825ae9e0f9d6b88e02a
BLAKE2b-256 checksum
How to use checksums
9cfae807665acf83de7dd67cdf0d5b36ef64aa86119d251efae2c320f7d07c53
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.4

Release files / python_selenium_google_form-0.7.2-py3-none-any.whl

Download URL python_selenium_google_form-0.7.2-py3-none-any.whl
Size 4.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
84ca162e8456c5d55731fcf8d8123b44caa5b687968e9e0dbb166dd195881be4
BLAKE2b-256 checksum
How to use checksums
01363e136bf012cfe1bc000cf6891596096ca51619e574805150f052bc400347
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.4

Security for python-selenium-google-form 0.7.2

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.

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