1

My .exe file does not run when my code includes Selenium - webdriver.

Here is my code (i named my script test.py):

from selenium import webdriver

driver = webdriver.Firefox()
url = "https://google.com/"
driver.get(url)

Then i run this on Powershell:

pyinstaller test.py

or this:

pyinstaller --onefile --windowed test.py

But when i try to run the test.exe file, i am getting the failed to execute script error.

I am on Win 10, Python 3.7 and latest PyInstaller (3.5).

I tried this solution:

pyinstaller one file --no-console does not work "Fatal Error"

but it didn't work. Note that when i use pyinstaller with a code that does not include Selenium, everything is fine so far.

Can you please advise?

Thanks.

1 Answer 1

1

Why you are getting this error because your script can't find gecko driver to execute script so you need to paste geckodriver in your file directory

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

1 Comment

Most Welcome! have a nice day

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.