cannot connect to chrome at 127.0.0.1:9222
- window10系统,先cmd打开chrome,
chrome --remote-debugging-port=9222
- 执行脚本
from selenium import webdriver from selenium.webdriver.chrome.options import Options from selenium.webdriver.common.by import By def test_adduser(): options=Options() options.add_experimental_option(‘debuggerAddress‘, ‘127.0.0.1:9222‘) driver=webdriver.Chrome(options=options) driver.implicitly_wait(5) driver.find_element(By.CSS_SELECTOR,‘.js_service_list a:nth-child(1) .index_service_cnt_item_title‘).click()
- 报错
> raise exception_class(message, screen, stacktrace) E selenium.common.exceptions.WebDriverException: Message: unknown error: cannot connect to chrome at 127.0.0.1:9222 E from chrome not reachable ..\venv\lib\site-packages\selenium\webdriver\remote\errorhandler.py:242: WebDriverException
重启电脑,问题解决
相关推荐
王练 2020-07-18
Reiki 2020-06-12
curiousL 2020-06-01
jessieHJ 2020-05-17
xiangxiaojun 2020-09-23
letheashura 2020-08-14
xiangxiaojun 2020-06-25
Feastaw 2020-06-18
ELEMENTS爱乐冬雨 2020-06-14
云之高水之远 2020-06-14
chongtianfeiyu 2020-06-12
songerxing 2020-06-11
王练 2020-06-11
tiankele0 2020-06-09
dangai00 2020-06-06
云之高水之远 2020-06-05