0

I have coded selenium Python script and now I want to compile it to exe file so it can run on computer without Python installed

I've tried to install cx-freeze and pyinstaller but failed to do so and wasn't able to find the patch for the errors I am getting while installing these modules

I have installed py2exe but its not able to convert selenium Python to exe

Whenever I execute I keep getting error msg

I want to use chromedriver, here's the error I am getting

FileNotFoundError: [Errno 2] No such file or directory: 'selenium\\webdriver\\re
mote\\getAttribute.js'
  • Possible duplicate of [Process to convert simple Python script into Windows executable](https://stackoverflow.com/questions/2136837/process-to-convert-simple-python-script-into-windows-executable) – Soumitri Pattnaik Mar 05 '18 at 10:59
  • The problem you're running into is solvable with the tools you mention. You just need to configure them appropriately if you plan to bundle chromedriver. See the [run-time information](https://pythonhosted.org/PyInstaller/runtime-information.html) section of the pyinstaller docs. In the case of PyInstaller, you need to explicitly add chromedriver to your bundle and use `sys._MEIPASS` to form paths to bundled data files. I have personally bundled a selenium project using PyInstaller, the same should be possible with these other tools, too. – sytech Mar 05 '18 at 15:08

1 Answers1

0

You have to manually copy the selenium folder in the root of your project, (this is what the message says) because it include contents that can't be compiled (such as getAttribute.js)

Sylvan LE DEUNFF
  • 682
  • 1
  • 6
  • 21