1

Code -------------------

from bs4 import BeautifulSoup
from urllib.request import urlopen
from selenium import webdriver

driver= webdriver.Chrome('C:\\Users\\hyeon\\Downloads\\chromedriver_win32')
driver = webdriver.PhantomJS('C:\\Users\\hyeon\\Downloads\\phantomjs-2.1.1-windows\\phantomjs-2.1.1-windows')
driver.implicitly_wait(3)
driver.get('https://google.com')

Output result ------------------

C:\Users\hyeon\PycharmProjects\pythonProject\venv\Scripts\python.exe C:/Users/hyeon/PycharmProjects/pythonProject/main.py
Traceback (most recent call last):
  File "C:\Users\hyeon\PycharmProjects\pythonProject\venv\lib\site-packages\selenium\webdriver\common\service.py", line 72, in start
    self.process = subprocess.Popen(cmd, env=self.env,
  File "C:\Users\hyeon\AppData\Local\Programs\Python\Python39\lib\subprocess.py", line 947, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "C:\Users\hyeon\AppData\Local\Programs\Python\Python39\lib\subprocess.py", line 1416, in _execute_child
    hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
PermissionError: [WinError 5] Access is denied

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\hyeon\PycharmProjects\pythonProject\main.py", line 5, in <module>
    driver= webdriver.Chrome('C:\\Users\\hyeon\\Downloads\\chromedriver_win32')
  File "C:\Users\hyeon\PycharmProjects\pythonProject\venv\lib\site-packages\selenium\webdriver\chrome\webdriver.py", line 73, in __init__
    self.service.start()
  File "C:\Users\hyeon\PycharmProjects\pythonProject\venv\lib\site-packages\selenium\webdriver\common\service.py", line 86, in start
    raise WebDriverException(
selenium.common.exceptions.WebDriverException: Message: 'chromedriver_win32' executable may have wrong permissions. Please see https://sites.google.com/a/chromium.org/chromedriver/home

Process finished with exit code 1

I rebooted it. Reset the file path. I searched for the error code on Google. I can't find the answer. How do I fix this?

이현도
  • 21
  • 2
  • I think it doesn't have permission to access the file/folder – TheSavageTeddy Oct 29 '20 at 06:01
  • How do I give Pycharm access? I've already given Pycharm the right to be an administrator. – 이현도 Oct 29 '20 at 06:07
  • Does this answer your question? ['Webdrivers' executable may have wrong permissions. Please see https://sites.google.com/a/chromium.org/chromedriver/home](https://stackoverflow.com/questions/47148872/webdrivers-executable-may-have-wrong-permissions-please-see-https-sites-goo) – Tibebes. M Oct 29 '20 at 06:33
  • i write driver = webdriver.Chrome(executable_path ~~.exe) but pycharm tell me FileNotFoundError: [WinError 2] – 이현도 Oct 29 '20 at 06:51

0 Answers0