修改程式碼如下解決:
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
path = 'chromedriver.exe'
option = webdriver.ChromeOptions()
option.add_experimental_option('detach', True)
s = Service(executable_path=path)
browser = webdriver.Chrome(service=s, options=option)
url = 'https://www.jd.com'
browser.get(url)