When you use import
statements in your script, PyInstaller automatically detects the modules imported and include them to the compiled EXE. It can detect a lot of modules, and selenium is between them (full list)
CLICK HERE to find out more related problems solutions.