problems in making python selenium and chromedriver work on mac

801 views
Skip to first unread message

Gabriele Brambilla

unread,
Sep 3, 2018, 10:38:41 PM9/3/18
to Selenium Users
Hi all,

I installed Selenium on a mac through pip (python). 
Then, I downloaded chromedriver and placed it in a folder and added it to $PATH
gbrambil% echo $PATH

/Users/gbrambil/Desktop/booking_bot/chrome-driver:/opt/local/bin:/opt/local/sbin:/opt/local/bin:/opt/local/sbin:/usr/X11R6/bin:/bin:/usr/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/texbin


following:
https://selenium-python.readthedocs.io/installation.html

I'm trying to run this simple code (bot.py):
import os
from selenium import webdriver
browser
= webdriver.Chrome()

browser
.get('http://seleniumhq.org/')



However, when I try to run it, I still get:


gbrambil
% python bot.py

Traceback (most recent call last):

 
File "bot.py", line 5, in <module>

 browser
= webdriver.Chrome()

 
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/selenium/webdriver/chrome/webdriver.py", line 68, in __init__

 
self.service.start()

 
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/selenium/webdriver/common/service.py", line 83, in start

 os
.path.basename(self.path), self.start_error_message)

selenium
.common.exceptions.WebDriverException: Message: 'chromedriver' executable needs to be in PATH. Please see https://sites.google.com/a/chromium.org/chromedriver/home

Do you have any idea of what is going wrong?

Thanks

GB

Abhijit Mone

unread,
Sep 4, 2018, 7:18:47 AM9/4/18
to seleniu...@googlegroups.com
You need to provide the path

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/24306f9c-9a4c-4fe1-87ef-c6ec03a37b4e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Gabriele Brambilla

unread,
Sep 4, 2018, 11:19:17 AM9/4/18
to seleniu...@googlegroups.com
Hi Abhijit,

I tried to provide the path:
I unzipped the file for mac downloaded from here

I copied the executable it in this folder

/Users/gbrambil/Desktop/booking_bot/chrome-driver

That I included in PATH (see previous email)!!!

I don't get why it does not work...

GB





Abhijit Mone

unread,
Sep 4, 2018, 12:22:39 PM9/4/18
to seleniu...@googlegroups.com
You need to give the path of the chrome driver

Gabriele Brambilla

unread,
Sep 4, 2018, 2:38:52 PM9/4/18
to seleniu...@googlegroups.com
Hi Abhijit,

This is the path of the driver:

gbrambil% ls -l Desktop/booking_bot/chrome-driver/
total 23896
-rwxr-xr-x  1 gbrambil  staff  12234724 Jul 27 11:17 chromedriver


This is my PATH variable

gbrambil% echo $PATH
/Users/gbrambil/Desktop/booking_bot/chrome-driver:/opt/local/bin:/opt/local/sbin:/opt/local/bin:/opt/local/sbin:/usr/X11R6/bin:/bin:/usr/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/texbin


I am already giving the path of the driver to the PATH variable.
If you mean something different, please explain.


Thanks,

GB


Abhijit Mone

unread,
Sep 4, 2018, 2:48:55 PM9/4/18
to seleniu...@googlegroups.com
https://www.youtube.com/watch?v=XFVXaC41Xac, try this tutorial , i hope it helps



For more options, visit https://groups.google.com/d/optout.


--
"When the footsteps are good u should follow them"
Abhijit Mone
9890615400

Gabriele Brambilla

unread,
Sep 4, 2018, 2:57:32 PM9/4/18
to seleniu...@googlegroups.com
Thanks Abhijit,

it works. I don't understand why it doesn't work the other way around but it's ok!

GB

Abhijit Mone

unread,
Sep 4, 2018, 3:03:34 PM9/4/18
to seleniu...@googlegroups.com
Thats was i was trying to explain :)


For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages