Skip to content

Instantly share code, notes, and snippets.

@sefgit
Created June 12, 2024 10:34
Show Gist options
  • Save sefgit/1ee571d0d32d7ca2cdac3bb6ef590add to your computer and use it in GitHub Desktop.
Save sefgit/1ee571d0d32d7ca2cdac3bb6ef590add to your computer and use it in GitHub Desktop.
python platform check
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