Google Colab Selenium
1.0.0

基本的な使用法:
%pip install google-colab-selenium検出されないクロムドライバーバージョンを使用します。
%pip install google-colab-selenium[undetected] import google_colab_selenium as gs
driver = gs . Chrome ()
# Your code to interact with the driver here
# ...
driver . quit () import google_colab_selenium as gs
driver = gs . UndetectedChrome ()
# Your code to interact with the driver here
# ...
driver . quit ()google-colab-seleniumパッケージには、Google Colab環境向けに最適化された一連のデフォルトオプションが入っています。これらのデフォルトは次のとおりです。
--headless :ヘッドレスモード(GUIなし)でクロムを実行します。--no-sandbox :Colab環境で必要なChrome Sandboxing機能を無効にします。--disable-dev-shm-usage :Dockerコンテナの共有メモリが限られている問題を防ぎます。--lang=en :言語を英語に設定します。ニーズに基づいてこれらのオプションを拡張またはオーバーライドすることをお勧めします。
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 )貢献は大歓迎です!提案や問題がある場合は、問題トラッカーを使用してお知らせください。