버전 추출 스크립트

## 현재 폴더 값을 가져 옵니다.
A_Folder  = os.path.dirname(__file__) 

## PC 마다 크롬 설치 경로에 차이가 있을 수 있으므로 폴더를 검색하여 파일 존재 여부를 확인합니다.
path = r"C:\Program Files\Google\Chrome\Application\chrome.exe"
if not os.path.exists(path): 
	## 파일이 없으면 폴더를 변경해 줍니다.
	path = r"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe"

## 한번 더 파일 체크 후 버전 체크를 진행합니다.
if os.path.exists(path): 
	
	parser = Dispatch("Scripting.FileSystemObject")
	version = parser.GetFileVersion(path) 
    ## 버전을 표시 합니다.
	print(  version  )


## 만약 크롬 드라이버가 맞지 않는 경우 동작하는 코드 
## 크롬 드라이버 다운로드 페이지를 실행 시켜 줍니다.
subprocess.Popen([path , "https://chromedriver.storage.googleapis.com/index.html"])

 

 

 

 

 

+ Recent posts