-2

i wrote a BOT for a webgame, works perfectly when i run it with IDLE, firefox launches and does the job. But after compiling with Py2exe firefox doesn't launch anymore...Any ideas ?

PS : Firefox 45.0.2 , Selenium 2.53

F.Drake
  • 11
  • http://stackoverflow.com/questions/21098527/make-exe-file-from-python-selenium-tests have a look this page. – Taylan Apr 16 '16 at 18:50
  • I already included all files of selenium...Or i wouldn't ask.... – F.Drake Apr 17 '16 at 06:17
  • I mean in my dist/selenium i included wedriver.xpi and webdriver_prefs.json but still it cannot find Firefox... – F.Drake Apr 17 '16 at 06:24
  • Well I can not help you, but I've done little destkop app using selenium and tkinter, I converted it to exe with pyinstaller and works properly. – Taylan Apr 17 '16 at 06:27
  • I have same issue with previously working bot. Why are there so many downvotes? Please elaborate some details in the question so that problem gets solved and we get less downvotes. – Shaardool Apr 17 '16 at 15:06

1 Answers1

0

Hum finally i solved it, was my mistake, i was copying th wedriver.xpi and webdriver_prefs.json in the wrong directory...

So you need to compile it without making a Zipfile (or won't work) and copy the 2 files in the good directory :

from : C:\Python27\Lib\site-packages\selenium\webdriver\firefox

to : /dist/selenium/webdriver/firefox

Setup.py example:

from distutils.core import setup
import py2exe



setup(
name='Web BOT',
version='1.0',
description='BOT',
author='Author',
author_email='mymail@mail.com',
url='',
windows = [{
        "script":"Myscript.py",
        "icon_resources": [(1, "myicon.ico")],
        }],
options={
    'py2exe':
        {
            'skip_archive': True,
            'optimize': 2,
        }
}
)

And then everything works fine !

F.Drake
  • 11