This siteIt is in

Tested in non-headless mode

I want to move the code in the item of

NameError: name'driver' is not defined
selenium.common.exceptions.SessionNotCreatedException: Message: session not created: This version of ChromeDriver only supports Chrome version 87
Current browser version is 86.0.4240.198 with binary path ・ ・ ・

Chrome is displayed for a moment and disappears for a moment.
driver.get ('https://www.google.com/')
When an error occurs in
driver = webdriver.Chrome ()
May cause an error.

import time
from selenium import webdriver
import chromedriver_binary
driver = webdriver.Chrome ()
driver.get ('https://www.google.com/')
time.sleep (5)
search_box = driver.find_element_by_name ("q")
search_box.send_keys ('ChromeDriver')
search_box.submit ()
time.sleep (5)
driver.quit ()
What I tried

When downloading the binary directly

I tried the means of. As a result, I got a message (Starting ChromeDriver 87.0.4280.20 ...) that I'm not sure if it was a success or a failure.

Supplementary information (FW/tool version, etc.)

When installing with pip

I installed it by the method described in the item.

  • Answer # 1

    You need to match the chromedriver_binary and chrome versions.
    It doesn't have to be an exact match, but let's reinstall the version with the closest number.

    pip install chromedriver-binary ==

    I get an error and the installable version is displayed, so

    pip install chromedriver-binary == xx.x.xxxx.xx

    Please specify the version to install.

    You can see the version of Chrome in the menu Help → About Google Chrome.