I'm trying to create the Chrome webdriver binary for bundling into my executable but the .spec file isn't doing what I ask..
My project code has the following -
from selenium import webdriver
driver = webdriver.Chrome("/Users/me/.wdm/drivers/chromedriver/mac64/96.0.4664.45/chromedriver")
This is correct and all works well when I run in IDLE.
Here's the relevant section of the 'project.spec' file for PyInstaller -
a = Analysis(['project.py'],
pathex=['/Users/me/Desktop/project'],
binaries=[('/Users/me/.wdm/drivers/chromedriver/mac64/96.0.4664.45/chromedriver', './selenium/webdriver')],
datas=[],
The selenium and webdriver folders build correctly in dist -
/dist/project/selenium/webdriver
but in here I have two folders, neither of which contain the Chrome webdriver -
/firefox
/remote
Just a folder for Firefox (which I don't use and have never mentioned once in any of my code) with the FF webdriver and a .xpi file, and the 'remote' folder, which contains 'getAttribute.js' and 'isDisplayed.js'.
I've obviously tried running the executable and it's fine until the point the webdriver is required, at which point it throws -
AttributeError: module 'selenium.webdriver' has no attribute 'Chrome'
How can I get this working? I've seen several similar questions but none of them are helping me. I'm new to PyInstaller and have never created a binary like this before. What am I missing?