2

I have created a set of python scripts that scrape information out of a website using Internet Explorer. This methodology while not ideal, is the only way I could get it to work as the site does not work well with other browsers and has single-sign on authentication which was difficult to deal with through requests. Anyways, it works. I'd like to be able to share with coworkers without them needing to install python or modify scripts.

I was able to create an executable of the scripts that works on my computer through pyinstaller. When I share with coworkers, though, the get an error "local variable 'browser' referenced before assignment." I tried referencing the IEWebdriverService.exe the binaries field of the pyinstaller .spec file. This caused the size of the .exe to grow so it did something..but it didn't solve the problem.

This is my first time creating an executable and I have really no idea how the IE Driver works so I'm stuck at the moment. Any help would be greatly appreciated. I'm open to using another tool than pyinstaller if that helps, I just found it the easiest to use of the alternatives. I'm using Python 3.5.

thanks.

Edit - Error Log

run # 1
['Part Number = 12649189']
Error
Exception ignored in: <bound method Service.__del__ of <selenium.webdriver.ie.se
rvice.Service object at 0x0000000004D00D30>>
Traceback (most recent call last):
  File "site-packages\selenium\webdriver\common\service.py", line 173, in __del_
_
  File "site-packages\selenium\webdriver\common\service.py", line 145, in stop
AttributeError: 'Service' object has no attribute 'process'
['Part Number = 12649189']
Error
Exception ignored in: <bound method Service.__del__ of <selenium.webdriver.ie.se
rvice.Service object at 0x0000000004D00D30>>
Traceback (most recent call last):
  File "site-packages\selenium\webdriver\common\service.py", line 173, in __del_
_
  File "site-packages\selenium\webdriver\common\service.py", line 145, in stop
AttributeError: 'Service' object has no attribute 'process'
['Part Number = 12649189']
Error
Exception ignored in: <bound method Service.__del__ of <selenium.webdriver.ie.se
rvice.Service object at 0x0000000004D00D30>>
Traceback (most recent call last):
  File "site-packages\selenium\webdriver\common\service.py", line 173, in __del_
_
  File "site-packages\selenium\webdriver\common\service.py", line 145, in stop
AttributeError: 'Service' object has no attribute 'process'

Traceback (most recent call last):
  File "Parent_Part_W_UI.py", line 138, in <module>
  File "Parent_Part_W_UI.py", line 23, in __init__
  File "Parent_Part_W_UI.py", line 40, in init_window
  File "Parent_Part_W_UI.py", line 122, in execute_main
UnboundLocalError: local variable 'browser' referenced before assignment
  • I'm not adding this as an answer but my understanding is that they will need IEwebdriver on their local machine under the appropriate path. The error that you're returning seems like dependency hell to me. Try having them manually install IEwebdriver on their machine and try running the scripts again. – Wunderbread Jun 05 '17 at 16:37
  • I had them place IEWebDriver.exe in the same folder as my executable so that it would definitely see it. It didn't solve the problem. – Eumpfenbach Jun 05 '17 at 17:45
  • I went ahead and voted for your question. Can you post the full error log as well? – Wunderbread Jun 06 '17 at 14:34
  • Updated with error log – Eumpfenbach Jun 07 '17 at 16:38

0 Answers0