简体   繁体   中英

Python Selenium: Unable to Open Chrome Browser

Whenever I try it says Chrome closed unexpectedly and asks to reOpen. At python end it gives error:

  raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: unknown error: Chrome failed to start: was killed
  (Driver info: chromedriver=2.0,platform=Mac OS X 10.10.2 x86_64)

My code is:

driver = None
profile = webdriver.Chrome('/Setups/chromedriver')
driver.set_window_size(1128, 768) # optional
url = 'http://google.com'
driver.get(url)

Update : running in verbose mode gives this:

在此处输入图片说明

You are trying to set size of none object. Try

driver = webdriver.Chrome('/Setups/chromedriver')
driver.set_window_size(1128, 768)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM