Skip to main content

Easily use Selenium in Google Colab Notebooks!

Project description

The best way to use Selenium in Google Colab Notebooks!

  • Simple setup of Selenium and ChromeDriver.
  • Seamless integration with Google Colab.
  • Supports Undetected ChromeDriver for more advanced use cases.

Open In Colab

Installation

Basic usage:

%pip install google-colab-selenium

Use undetected-chromedriver version:

%pip install google-colab-selenium[undetected]

Basic Usage

import google_colab_selenium as gs

driver = gs.Chrome()
# Your code to interact with the driver here
# ...
driver.quit()

Undetected ChromeDriver

import google_colab_selenium as gs

driver = gs.UndetectedChrome()
# Your code to interact with the driver here
# ...
driver.quit()

Default Options

The google-colab-selenium package is preconfigured with a set of default options optimized for Google Colab environments. These defaults include:

  • --headless: Runs Chrome in headless mode (without a GUI).
  • --no-sandbox: Disables the Chrome sandboxing feature, necessary in the Colab environment.
  • --disable-dev-shm-usage: Prevents issues with limited shared memory in Docker containers.
  • --lang=en: Sets the language to English.

You are welcome to extend or override these options based on your needs:

from selenium.webdriver.chrome.options import Options
import google_colab_selenium as gs

custom_options = Options()
# Add your custom options here

driver = gs.Chrome(options=custom_options)

Contributing

Contributions are welcome! If you have a suggestion or an issue, please use the issue tracker to let me know.



Test it out for yourself!

Open In Colab

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

google_colab_selenium-1.0.15.tar.gz (6.4 kB view details)

Uploaded Source

Built Distribution

google_colab_selenium-1.0.15-py3-none-any.whl (8.3 kB view details)

Uploaded Python 3

File details

Details for the file google_colab_selenium-1.0.15.tar.gz.

File metadata

File hashes

Hashes for google_colab_selenium-1.0.15.tar.gz
Algorithm Hash digest
SHA256 518a543c4d8daeb9f173432e5379994148f383f66490936843e147b5f1d0b027
MD5 0f4c84120946d62a961eb7c0220e3d2a
BLAKE2b-256 522d437d1db454d7f4654f124b9d0cfd6878a4f0dca8d373bb7b0de552aa768f

See more details on using hashes here.

File details

Details for the file google_colab_selenium-1.0.15-py3-none-any.whl.

File metadata

File hashes

Hashes for google_colab_selenium-1.0.15-py3-none-any.whl
Algorithm Hash digest
SHA256 6d4d3c1c6866ed744f62e683e69d9d21cbbfe6aa5ac08654653af3bab72a1386
MD5 7cf69e9306e9f1d0b182baf9b02cfe17
BLAKE2b-256 2b9f9c5631bcc6746e98e71ad5d15c62ea61e3e301326b899f9e7e6e03b5012f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page