jpjacobpadilla / Google-Colab-Selenium

The best way to use Selenium in Google Colab Notebooks!
https://pypi.org/project/google-colab-selenium/
MIT License
181 stars 20 forks source link
chromedriver colab-notebooks google google-colab-notebook google-colaboratory google-colaboratory-notebooks pypi-package python python-selenium selenium selenium-python undetected-chromedriver

The best way to use Selenium in Google Colab Notebooks!

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:

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](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1MX3xY23Go1STe7LbDMvwf2KaqHpbrVhC?usp=sharing)