I successfully linked the chrome recorder to pyinstaller (although, unfortunately, my virusscanner noted it after running exe, but this is another problem)
I think your problem is that you did not specify the correct path to the webdriver in the script (using the executable_path keyword). Also, I included chromedriver in the data file, although I'm not sure if that matters.
Here is my example.
sel_ex.py:
from selenium import webdriver
import os, sys, inspect
current_folder = os.path.realpath(os.path.abspath(os.path.split(inspect.getfile(inspect.currentframe() ))[0]))
def init_driver():
chromedriver = os.path.join(current_folder,"chromedriver.exe")
driver = webdriver.Chrome(executable_path = chromedriver)
return driver
if __name__ == "__main__":
driver = init_driver()
driver.get("http://www.imdb.com/")
sel_ex.spec:
....
binaries=[],
datas=[("chromedriver.exe",".")],
....
Thus, the chrome record was stored in the main folder, although it does not matter where it is stored if the correct script path is through the executable_path keyword
disclaimer: -I have not used the parameters of a single file, but this should not change. -my OS are windows
source
share