selenium_未報錯但是閃退的問題

Hbro發表於2024-08-04

修改程式碼如下解決:

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)

相關文章