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.
- Support for undetected ChromeDriver for more advanced use cases.
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 us know.
You can also contact me here.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for google-colab-selenium-1.0.12.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 37256e51a72ab7fd39f2526b3841cefc06f4ef78849065eb8dc00fe400efd1f5 |
|
MD5 | 014614c91a49b19e41cb17eadb53f340 |
|
BLAKE2b-256 | 0ed26f756379016c28944428cca616d987d36fc87150d9659e2d6ed468d199a7 |
Close
Hashes for google_colab_selenium-1.0.12-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 95492b698fe0f28b0b09d5e04f8f3c1fbd686592382fd8f380fa63c216d7de01 |
|
MD5 | e03a32b28eec973e68fe6081cb050d09 |
|
BLAKE2b-256 | 8b8bf6f4d491227e0cbfd79c53a30aa696d0233a0abb841c82330a438bdc49be |