Please how do get selenium working in this scenerio? I have seen this questions times with fewer or no answers and i hope luck is on my side today.
Let me start by detailing my environment.
- I am running MacOS Seirra.
I am using virtualenv/virtualenvwrapper with python3 to run the following.
from selenium import webdriver from selenium.webdriver.common.keys import Keys import os chromedriver = "/usr/local/bin/chromedriver" os.environ["webdriver.chrome.driver"] = chromedriver driver = webdriver.Chrome() driver.get("http://www.python.org") print(driver.title) driver.quit()
The lines below were added after i followed example from similar question here
chromedriver = "/usr/local/bin/chromedriver" # i used brew to install chrome to get this path from the command 'which chromedriver'
os.environ["webdriver.chrome.driver"] = chromedriver
Alternatively i downloaded chromedriver directly from github and added the path as follows:
/Users/Me/Downloads/chromedriver
I have triend not passing arguements to the driver but i still get this error.
Traceback (most recent call last):
File "aicpa.py", line 8, in <module>
driver = webdriver.Chrome()
File "/Users/Me/.virtualenvs/aicpa/lib/python3.5/site-packages/selenium/webdriver/chrome/webdriver.py", line 62, in __init__
self.service.start()
File "/Users/Me/.virtualenvs/aicpa/lib/python3.5/site-packages/selenium/webdriver/common/service.py", line 102, in start
raise WebDriverException("Can not connect to the Service %s" % self.path)
selenium.common.exceptions.WebDriverException: Message: Can not connect to the Service chromedriver
Complements of the season and thanks in advance.