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.17.tar.gz (6.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

google_colab_selenium-1.0.17-py3-none-any.whl (10.9 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for google_colab_selenium-1.0.17.tar.gz
Algorithm Hash digest
SHA256 cdf5a7965eadc0e28d4286063fc650159afbe51c082137279467155110aa6c85
MD5 64e9931d1da12a2f70e6369731e9cc16
BLAKE2b-256 eb324c9125494f6dbc1c071e49aeecc82bebc4cf38415f4a4272fc4dfeff0ceb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for google_colab_selenium-1.0.17-py3-none-any.whl
Algorithm Hash digest
SHA256 0d832091dfc0da05c3c8f39346f6bfd2c78850684f9905a45fe3552f51f700a4
MD5 2e080c1db44ad0b9bdb07e6cc2c76d31
BLAKE2b-256 1f5520a64c8ff5ae8f5003c43aa59b2ae68c64d8ea8b2bf0f30e70eb9e78f8c8

See more details on using hashes here.

Supported by

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