Getting selenium to launch safari with default profile in python Getting selenium to launch safari with default profile in python selenium selenium

Getting selenium to launch safari with default profile in python


From what I have read, Safari does not have user profiles. If you mean to start Safari from a different Mac user I would suggest doing it with bash:

sudo -u username python open.py

where username is the username of the user and open.py is your python file.


There is setDataDir() function in SafariOptions on safari driver v2.43.1 according to document as following however I couldn't find any document about how to use it and there is no information about last versions:

* @param dataDir A File object pointing to the Safari installation's data directory.* If {@code null}, the default installation location for the current platform will be used.  public void setDataDir(File dataDir) {    this.dataDir = Optional.fromNullable(dataDir);  }