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.

Community
  • 1
  • 1
daOnlyBG
  • 595
  • 4
  • 20
  • 49

1 Answers1

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.

Yuro Doosh
  • 65
  • 4
  • 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 Nov 21 '16 at 02:22
  • @daOnlyBG The uppercase letter matters because thats not the of the executable. File names and paths are case sensitive. – heinst Nov 21 '16 at 02:34
  • @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." – daOnlyBG Nov 21 '16 at 02:36