Selenium-Profiles icon indicating copy to clipboard operation
Selenium-Profiles copied to clipboard

Pyinstaller executable fails

Open AlexPaiva opened this issue 1 year ago • 3 comments

Describe the bug Using pyinstalelr to turn a script into an .exe makes the driver not open, simply flash a console and not open.

To Reproduce

from selenium_profiles.webdriver import Chrome
from selenium_profiles.profiles import profiles
from selenium_driverless.webdriver import ChromeOptions
from selenium_driverless.types.by import By

profile = profiles.Windows()  # or .Android
options = ChromeOptions()
# options.add_argument("--headless=new")
driver = Chrome(profile, options=options, driverless_options=True)

# get url
driver.get('https://nowsecure.nl#relax')  # test fingerprint

driver.quit()  # Execute on the End!

Expected behavior or error-message A clear and concise description of what you expected to happen.

No error messages

Environment (please complete the following information):

  • OS: Windows
  • OS-Version 10
  • Browser Chrome latest
  • Selenium-Profiles Version Latest
  • Selenium Version Latest
  • selenium-driverless Version Latest
  • Python versin 3.10

Additional context Initially it gave a missing 'Failed to execute script 'pyi_rth_wind32api' due to unhandled exception: DLL load failed' error but manually adding it as a binary import seems to work.

AlexPaiva avatar Sep 04 '23 22:09 AlexPaiva

Also getting:

2023-09-05 00:10:34 - FATAL ERROR OCCURED: Traceback (most recent call last):
  File "main.py", line 4495, in signup
  File "concurrent\futures\_base.py", line 446, in result
  File "concurrent\futures\_base.py", line 391, in __get_result
  File "concurrent\futures\thread.py", line 58, in run
  File "main.py", line 4199, in gamiCalli
  File "selenium_profiles\profiles\profiles.py", line 12, in Windows
  File "selenium_profiles\profiles\profiles.py", line 6, in return_profile
  File "selenium_profiles\utils\utils.py", line 33, in read_json
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\Alex\\AppData\\Local\\Temp\\_MEI105282\\selenium_profiles/profiles/default.json'

I fixed that with manual json imports and making the utils.py and profiles.py code pyinstaller safe but still it just keeps trying to open a node console over and over again without any error

AlexPaiva avatar Sep 04 '23 23:09 AlexPaiva

@AlexPaiva

  1. Have you checked if the --user-data-dir=C:/some_path/data is valid?
  2. The chrome process starts at https://github.com/kaliiiiiiiiii/Selenium-Driverless/blob/4e478d26ce7090192ff45d835e1efb31bd7bf98c/src/selenium_driverless/webdriver.py#L220 , check what path & arguments are there.

kaliiiiiiiiii avatar Sep 05 '23 04:09 kaliiiiiiiiii

@AlexPaiva Does it work with driverless_options=False btw?

kaliiiiiiiiii avatar Sep 05 '23 20:09 kaliiiiiiiiii