By Ash1x


2017-11-07 02:06:20 8 Comments

I've looked around checked both documentations and have found no answer.

I've been trying to use InstaPy a instagram api for python. After failing with multiple errors and assuming InstaPy is just having some issues so i tried to raw code it using selinium. after inserting the example code and alter it to my liking i just made sure this one would work. I received a new error instead of the old one saying the permissions may not be right. I have tried reinstall and running as admin but nothing works. how do i fix this and/or what does this mean

Code:

import time
from selenium import webdriver

driver = webdriver.Chrome('C:\Webdrivers')  # Optional argument, if not specified will search path.
driver.get('http://www.google.com/xhtml');
time.sleep(5) # Let the user actually see something!
search_box = driver.find_element_by_name('q')
search_box.send_keys('ChromeDriver')
search_box.submit()
time.sleep(5) # Let the user actually see something!
driver.quit()

Error:

Traceback (most recent call last):
  File "C:\Program Files (x86)\Python36-32\lib\site-packages\selenium\webdriver\common\service.py", line 74, in start
    stdout=self.log_file, stderr=self.log_file)
  File "C:\Program Files (x86)\Python36-32\lib\subprocess.py", line 707, in __init__
    restore_signals, start_new_session)
  File "C:\Program Files (x86)\Python36-32\lib\subprocess.py", line 990, in _execute_child
    startupinfo)
PermissionError: [WinError 5] Access is denied

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Webdrivers\RawBot.py", line 5, in <module>
    driver = webdriver.Chrome('C:\Webdrivers')  # Optional argument, if not specified will search path.
  File "C:\Program Files (x86)\Python36-32\lib\site-packages\selenium\webdriver\chrome\webdriver.py", line 62, in __init__
    self.service.start()
  File "C:\Program Files (x86)\Python36-32\lib\site-packages\selenium\webdriver\common\service.py", line 86, in start
    os.path.basename(self.path), self.start_error_message)
selenium.common.exceptions.WebDriverException: Message: 'Webdrivers' executable may have wrong permissions. Please see https://sites.google.com/a/chromium.org/chromedriver/home

4 comments

@Yuvraj Singh 2019-06-12 10:11:48

if you are using chrome you must specify the full path of the chromedriver. search for the directory in which your chromedriver executable file resides. click shift+right click on the executable file. select "copy as path" and paste it in your script. don't forget to use a double backslash

so it should be:

driver = webdriver.Chrome('C:\\Utility\\BrowserDrivers\\chromedriver.exe')

@josuedjh 2018-09-01 19:46:42

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

selenium.common.exceptions.WebDriverException: Message: 'chromedriver' executable may have wrong permissions. Please see https://sites.google.com/a/chromium.org/chromedriver/home

@guillermo chamorro 2018-09-01 19:54:17

It would be better your answer to be more clear, add explanations and references to the OP question, and links only for further reference.

@Ramana 2017-11-13 01:19:10

This got solved when you enter the full file name which is "chromedriver.exe". Try this if you are on windows

@Mostafa 2019-02-05 09:18:32

What about Ubuntu?

@DebanjanB 2017-11-07 06:00:10

The error says it all WebDriverException: Message: 'Webdrivers' executable may have wrong permissions..

You have tried out:

driver = webdriver.Chrome('C:\Webdrivers')  # Optional argument, if not specified will search path.

A few words:

  1. On Windows, if you are explicitly specifying the chromedriver binary path you have to provide it along with the binary extension.

  2. On Windows, while mentioning the chromedriver binary path you have to either use the single front slash (/) along with the raw (r) switch or you have to use the escaped back slash (\\).

  3. So the line will be :

    driver = webdriver.Chrome(executable_path=r'C:/Utility/BrowserDrivers/chromedriver.exe')
    

@aspiringGuru 2019-04-11 01:29:34

on windows 10 & python 3.7.1 I didn't need the raw (r) switch. Also didn't need the 'executable_path=' Not entirely sure why, link below indicates os.path.normpath corrects this. It's possible this practice has been included in webdriver.Chrome() pythonconquerstheuniverse.wordpress.com/2008/06/04/…

Related Questions

Sponsored Content

0 Answered Questions

Selenium module Troublshooting

1 Answered Questions

Error in creating a firefox session in selenium

1 Answered Questions

[SOLVED] python selenium windows chrome webdriver giving error

0 Answered Questions

Starting firefox-selenium macos

2 Answered Questions

[SOLVED] Click button script with Python

1 Answered Questions

0 Answered Questions

Error while trying to open chrome python-selenium

Sponsored Content