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.11.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1e6b5c8eb91468df19a0ed7036f11768054445ec9206ee01e8b260fa2dd4ef3a |
|
MD5 | e0c9b0aeef86fa6ad24808756e41a5f3 |
|
BLAKE2b-256 | 8bb083a1a0b5845fb80d9564051bd451a073c2b12e0b061718218d884b710ded |
Close
Hashes for google_colab_selenium-1.0.11-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ebc6e5e75f68f431f34603a66b06238e544b8ee3a0d0fd886b721558adac98b5 |
|
MD5 | b08690f63e4774ec7e76c5602e94e897 |
|
BLAKE2b-256 | ffb3278334f70f56cd08bf294e7f8b02f68a068355411c8e66f601b336b8f968 |