简体   繁体   中英

PermissionError: [Errno 13] Permission denied: on Ubuntu trying to run Selenium with Python

I am trying to start working with Selenium in Python w/ Ubuntu and it's been quite difficult for now. After some time fighting with the "not in PATH" error, I just put GeckoDriver on the same folder as the.py and added webdriver.Firefox(executable_path='/path/to/gecko') for it work.

Now, it seems that Python can find GeckoDriver exec, but there are permission problems. I've read some similar questions but wasn't able to solve my case, since most of them are talking about Windows systems.

The error I get is the following:

PermissionError: [Errno 13] Permission denied: {path here}

How can I grant Gecko the permission to run? And is there a way to do it everytime I run the script, or it has to be a permanent permission?

Thanks a lot in advance.

Just Try giving Read, Write, Execute permission to the dir where GeckoDriver is present. In any Ubuntu base system, you can achieve this by executing the below command on terminal before running the py script.

sudo chmod -R 777 /path/to/gecko

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM