1

I'm a Python beginner and trying to use selenium to automate a web browsing process. Unfortunately, my attempts are not as smooth as I'd like them to be; for whatever reason, the command line is returning an error saying "permission denied" when I run the following code:

from selenium import webdriver
from selenium.webdriver.firefox.firefox_binary import FirefoxBinary

binary = FirefoxBinary('C:\Program Files (x86)\Mozilla Firefox')
browser = webdriver.Firefox(firefox_binary=binary)

print(type(browser))

I've tried to read previous posts on this topic- specifically this one and that one- but each to no avail. Either the compiler returns "permission denied," or in the case of adding firefox.exe to the end of the path, "entity not found."

I appreciate any help you could give me. If you could explain any help like you would to an 8-year old, it'd be particularly helpful- I'm still a novice to this stuff.

Edited to add: if it helps provide any context, I'm using Windows 10 and running Python on Visual Studio Community. I've also thought about using the sudo command for permission, but I'm not exactly sure how I'd do that from Visual Studio.

1 Answer 1

1

Try adding Firefox.exe instead of firefox.exe to your path.

I've also had this issue before and it has worked for me, though I'm not exactly sure why.

Sign up to request clarification or add additional context in comments.

3 Comments

Finally- it worked! Thanks for the suggestion. I'm open to other responses though, especially to see why the uppercase letter made the difference.
@daOnlyBG The uppercase letter matters because thats not the of the executable. File names and paths are case sensitive.
@heinst I'm aware they're case sensitive, but when I right-click on the Firefox executable and inspect its properties, its name is "firefox" as opposed to "Firefox."

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.