decode: utf-8
import os
from selenium import webdriver
import time
firefox_driver = r"C:\Program Files (x86)\Mozilla Firefox\firefox.exe"
driver = webdriver.Firefox(executable_path = firefox_driver)
driver.get("http://finance.yahoo.com/gainers?e=us")
driver.close()
-------------------------------------------------------------------- WebDriverException Traceback (most recent call last) <ipython-input-3-06211bd8fae0> in <module>() 5 6 firefox_driver = r"C:\Program Files (x86)\Mozilla Firefox\firefox.exe" ----> 7 driver = webdriver.Firefox(executable_path = firefox_driver) 8 driver.get("http://finance.yahoo.com/gainers?e=us") 9 driver.find_element_by_tag_name("div") C:\Program Files\Anaconda3\lib\site-packages\selenium\webdriver\firefox\webdriver.py in __init__(self, firefox_profile, firefox_binary, timeout, capabilities, proxy, executable_path, firefox_options, log_path) 138 if capabilities.get("marionette"): 139 self.service = Service(executable_path, log_path=log_path) --> 140 self.service.start() 141 142 capabilities.update(firefox_options.to_capabilities()) C:\Program Files\Anaconda3\lib\site-packages\selenium\webdriver\common\service.py in start(self) 94 count = 0 95 while True: ---> 96 self.assert_process_still_running() 97 if self.is_connectable(): 98 break C:\Program Files\Anaconda3\lib\site-packages\selenium\webdriver\common\service.py in assert_process_still_running(self) 107 raise WebDriverException( 108 'Service %s unexpectedly exited. Status code was: %s' --> 109 % (self.path, return_code) 110 ) 111 WebDriverException: Message: Service C:\Program Files (x86)\Mozilla Firefox\firefox.exe unexpectedly exited. Status code was: 1import os from selenium import webdriver chromedriver = "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" driver = webdriver.Chrome(chromedriver) driver.get("http://finance.yahoo.com/gainers?e=us") driver.close()
-------------------------------------------------------------------- WebDriverException Traceback (most recent call last) <ipython-input-1-6788a60d5105> in <module>() 2 from selenium import webdriver 3 chromedriver = "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" ----> 4 driver = webdriver.Chrome(chromedriver) 5 driver.get("http://finance.yahoo.com/gainers?e=us") 6 driver.close() C:\Program Files\Anaconda3\lib\site-packages\selenium\webdriver\chrome\webdriver.py in __init__(self, executable_path, port, chrome_options, service_args, desired_capabilities, service_log_path) 60 service_args=service_args, 61 log_path=service_log_path) ---> 62 self.service.start() 63 64 try: C:\Program Files\Anaconda3\lib\site-packages\selenium\webdriver\common\service.py in start(self) 94 count = 0 95 while True: ---> 96 self.assert_process_still_running() 97 if self.is_connectable(): 98 break C:\Program Files\Anaconda3\lib\site-packages\selenium\webdriver\common\service.py in assert_process_still_running(self) 107 raise WebDriverException( 108 'Service %s unexpectedly exited. Status code was: %s' --> 109 % (self.path, return_code) 110 ) 111 WebDriverException: Message: Service C:\Program Files (x86)\Google\Chrome\Application\chrome.exe unexpectedly exited. Status code was: 0