Python selelnium help.

Google Prince

Regular Member
Joined
Dec 24, 2015
Messages
209
Reaction score
182
I'm kind of a beginner programmer as I've dabbled with python on/off for about a year but recently really wanna commit myself to developing bots that automate some of my money making task.

So I got introduced to selenium. When trying to execute "driver = webdriver.Chrome()" for example I keep getting an error saying "executable needs to be in PATH."

I did some research & someone suggested I need to download and put the executable in the path. Then use the driveras normal.

I downloaded the executable but don't understand if I'm putting it in the right PATH or what? I'm still getting error.

I'm using Mac btw with python 3.5
 
Hello GooglesMyBtch!

First of all, I am not an expert. I am replying you because no body has done it yet and maybe you are in a hurry. Let's see if I can!

Have you tried to change the content of webdriver.Chrome() writing the path? For example:

driver = webdriver.Chrome("C:/Users/YOU/.../chromedriver_win32/chromedriver.exe").

I think it could be your problem. I guess that other python scripts works properly for you, right?
 
Hello GooglesMyBtch!

First of all, I am not an expert. I am replying you because no body has done it yet and maybe you are in a hurry. Let's see if I can!

Have you tried to change the content of webdriver.Chrome() writing the path? For example:

driver = webdriver.Chrome("C:/Users/YOU/.../chromedriver_win32/chromedriver.exe").

I think it could be your problem. I guess that other python scripts works properly for you, right?

yes I have and also get the error "executable may have wrong permissions."

but it doesn't have wrong permissions which I made sure to change.
 
lol got it to work with firefox but can't get it to work with Opera or Chrome.
 
  1. Download the ChromeDriver executable.
  2. Either create your own PATH to a unique folder on your mac or copy the file to an existing PATH directory. To do this:
    1. Open up Terminal
    2. Run sudo nano /etc/paths in the OSX terminal
    3. Enter your password
    4. Go to the bottom of the file and enter the path you wish to add
    5. My PATH looks like: /Users//Documents/WebDriver
    6. Control-x to quit
    7. Y to save
  3. To double check, quit Terminal and relaunch it. Run echo $PATH. You should see your newly added path in the stream of other paths already there.
  4. Finally, update your tests to run using ChromeDriver (include code snippet) and run your tests!

EDIT: Personally I prefer to use Chrome. I was a long supporter of f'fox... but for some weird reason Firefox was throwing errors for a selenium bot I made for etsy.com. However when I ran the same code with chromedriver instead it worked flawlessly.

One more thing, if you are not already using homebrew then you should. It saves me a ton of time and headache when managing my dev environment.
 
Last edited:
Back
Top