Last active
February 10, 2022 22:08
-
-
Save aleksandr-kotlyar/4ead7c37eaa18361e06bfcc71ea19a2b to your computer and use it in GitHub Desktop.
webdriver-manager in Google Colab example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"nbformat": 4, | |
"nbformat_minor": 0, | |
"metadata": { | |
"colab": { | |
"name": "Untitled1.ipynb", | |
"provenance": [], | |
"authorship_tag": "ABX9TyOauMUCpUvA6I5U3YyMrG4v", | |
"include_colab_link": true | |
}, | |
"kernelspec": { | |
"name": "python3", | |
"display_name": "Python 3" | |
}, | |
"language_info": { | |
"name": "python" | |
} | |
}, | |
"cells": [ | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"id": "view-in-github", | |
"colab_type": "text" | |
}, | |
"source": [ | |
"<a href=\"https://colab.research.google.com/gist/aleksandr-kotlyar/4ead7c37eaa18361e06bfcc71ea19a2b/untitled1.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"source": [ | |
"!chrome --version\n", | |
"!chromium --version\n", | |
"!chrome-browser --version\n", | |
"!chromium-browser --version" | |
], | |
"metadata": { | |
"colab": { | |
"base_uri": "https://localhost:8080/" | |
}, | |
"id": "FHSKvgFTpCMg", | |
"outputId": "94644134-0c45-4eeb-b505-4c7e70651fef" | |
}, | |
"execution_count": 9, | |
"outputs": [ | |
{ | |
"output_type": "stream", | |
"name": "stdout", | |
"text": [ | |
"/bin/bash: chrome: command not found\n", | |
"/bin/bash: chromium: command not found\n", | |
"/bin/bash: chrome-browser: command not found\n", | |
"/bin/bash: chromium-browser: command not found\n" | |
] | |
} | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"source": [ | |
"!apt-get update\n", | |
"!apt-get install chromium-browser" | |
], | |
"metadata": { | |
"id": "v7iNTmDdpQG4" | |
}, | |
"execution_count": null, | |
"outputs": [] | |
}, | |
{ | |
"cell_type": "code", | |
"source": [ | |
"!chromium-browser --version" | |
], | |
"metadata": { | |
"colab": { | |
"base_uri": "https://localhost:8080/" | |
}, | |
"id": "wJD_d7jZprwR", | |
"outputId": "47064f39-792a-419f-d547-1298b4f6070c" | |
}, | |
"execution_count": 11, | |
"outputs": [ | |
{ | |
"output_type": "stream", | |
"name": "stdout", | |
"text": [ | |
"Chromium 97.0.4692.71 Built on Ubuntu , running on Ubuntu 18.04\n" | |
] | |
} | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"source": [ | |
"!pip install webdriver-manager" | |
], | |
"metadata": { | |
"id": "qFdGtDluqQom" | |
}, | |
"execution_count": null, | |
"outputs": [] | |
}, | |
{ | |
"cell_type": "code", | |
"source": [ | |
"from webdriver_manager.chrome import ChromeDriverManager\n", | |
"from webdriver_manager.utils import ChromeType\n", | |
"driver_path = ChromeDriverManager(chrome_type=ChromeType.CHROMIUM).install()\n", | |
"print(driver_path)" | |
], | |
"metadata": { | |
"colab": { | |
"base_uri": "https://localhost:8080/" | |
}, | |
"id": "bhxh-QnJqafE", | |
"outputId": "9658cd31-f97b-42bb-e062-30bb6d02e89e" | |
}, | |
"execution_count": 14, | |
"outputs": [ | |
{ | |
"output_type": "stream", | |
"name": "stderr", | |
"text": [ | |
"\n", | |
"\n", | |
"====== WebDriver manager ======\n", | |
"Current chromium version is 97.0.4692\n", | |
"Get LATEST chromedriver version for 97.0.4692 chromium\n", | |
"There is no [linux64] chromedriver for browser in cache\n", | |
"Trying to download new driver from https://chromedriver.storage.googleapis.com/97.0.4692.71/chromedriver_linux64.zip\n", | |
"Driver has been saved in cache [/root/.wdm/drivers/chromedriver/linux64/97.0.4692.71]\n" | |
] | |
}, | |
{ | |
"output_type": "stream", | |
"name": "stdout", | |
"text": [ | |
"/root/.wdm/drivers/chromedriver/linux64/97.0.4692.71/chromedriver\n" | |
] | |
} | |
] | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment