0

I want to specify the path to a file in a python project on the pythonanywhere site. Unfortunately, I am getting an error. Here are pictures of the folder and console

Code:

driver = uc.Chrome(options=options, driver_executable_path="/user/KraKoff/files/home/KraKoff/chromedriver.exe")

Console

Folder

KraKoff_
  • 27
  • 4
  • Isn't that file just in `/home/KraKoff/chromedriver.exe`? There's nothing in the console that indicates that `/user/KraKoff/files` is part of the path. – wkl Aug 19 '22 at 19:14

2 Answers2

1

You are using

pythonanywhere

So you need to download and use the ChromeDriver executable of type instead of the type and you need to pass the absolute path without the extension i.e. .exe.


Solution

Your effective line of code will be:

driver = uc.Chrome(options=options, driver_executable_path="/user/KraKoff/files/home/KraKoff/chromedriver")
undetected Selenium
  • 183,867
  • 41
  • 278
  • 352
  • 1
    Downloaded linux version. With `/user/KraKoff/files/home/KraKoff/chromedriver` path the error stays the same. Tried `/home/KraKoff/chromedriver` and now and now the error is this: _Message: 'chromedriver' executable may have wrong permissions. Please see https://chromedriver.chromium.org/home_ Added print(uc.Patcher.data_path) in code and aslo in console is _PermissionError: [Errno 13] Permission denied: '/home/KraKoff/chromedriver'_ – KraKoff_ Aug 20 '22 at 09:55
  • Hi! facing the same problem. Have you managed to resolve the permission issue? – Ziyad Moraished Dec 24 '22 at 11:53
1

Do not specify the chromedriver path on PythonAnywhere. It is not necessary.

Glenn
  • 7,262
  • 1
  • 17
  • 23
  • Now it is _Message: unknown error: cannot connect to chrome at 127.0.0.1:60291 from chrome not reachable_ error... – KraKoff_ Aug 20 '22 at 10:04