I've created a Python exe file. When I run it on the computer it was coded on it works. However when I run it on another PC I get this error.
[Errno 2] No such file or directory: 'C:\\Users\\Owner\\AppData\\Local\\Temp\\_MEI180322\\seleniumwire\\ca.crt'
I think this is because when I was testing and coding another script a while ago I downloaded the certificate to see if that would help the browser. Now on this script it makes it fail.
How can I remove this so selenium/seleniumwire doesn't use ca.crt
?
This is from github if anyone else runs into problems. here
There's no need for users to install the key - users would only normally install ca.crt if they wished to get rid of the insecure icon displayed by the browser. However, Selenium Wire does need access to both the key and crt to perform request interception.
The way it works normally is Selenium Wire loads ca.crt and ca.key from its library module, concatenates them to a single file called seleniumwire-ca.pem and stores that in /.seleniumwire. From that point on, Selenium Wire will just use seleniumwire-ca.pem directly. It will only try and load ca.crt and ca.key again if seleniumwire-ca.pem disappears (e.g. is deleted).
It still feels like we need to crack the issue with PyInstaller not properly providing ca.crt and ca.key as this will resolve the issue properly. I'll try and do that as soon as I have some proper time.
One final thing to mention is that you can control the location of the .seleniumwire folder with the request_storage_base_dir option. That defaults to the system TEMP folder, but if you wanted to change that you can control it using that option.