Created
June 12, 2024 10:34
-
-
Save sefgit/1ee571d0d32d7ca2cdac3bb6ef590add to your computer and use it in GitHub Desktop.
python platform check
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import platform | |
# Determine the correct platform for the webdriver | |
system = platform.system() | |
arch, _ = platform.architecture() | |
if system == 'Linux': | |
if arch == '64bit': | |
webdriver = 'bin/linux64/chromedriver' | |
else: | |
webdriver = 'bin/linux32/chromedriver' | |
if system == 'Windows': | |
webdriver = 'bin/win32/chromedriver.exe' | |
if system == 'Darwin': | |
webdriver = 'bin/mac32/chromedriver' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment