MCPcopy
hub / github.com/FlareSolverr/FlareSolverr / get_chrome_exe_path

Function get_chrome_exe_path

src/utils.py:228–247  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

226
227
228def get_chrome_exe_path() -> str:
229 global CHROME_EXE_PATH
230 if CHROME_EXE_PATH is not None:
231 return CHROME_EXE_PATH
232 # linux pyinstaller bundle
233 chrome_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'chrome', "chrome")
234 if os.path.exists(chrome_path):
235 if not os.access(chrome_path, os.X_OK):
236 raise Exception(f'Chrome binary "{chrome_path}" is not executable. '
237 f'Please, extract the archive with "tar xzf <file.tar.gz>".')
238 CHROME_EXE_PATH = chrome_path
239 return CHROME_EXE_PATH
240 # windows pyinstaller bundle
241 chrome_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'chrome', "chrome.exe")
242 if os.path.exists(chrome_path):
243 CHROME_EXE_PATH = chrome_path
244 return CHROME_EXE_PATH
245 # system
246 CHROME_EXE_PATH = uc.find_chrome_executable()
247 return CHROME_EXE_PATH
248
249
250def get_chrome_major_version() -> str:

Callers 2

get_webdriverFunction · 0.85
get_chrome_major_versionFunction · 0.85

Calls 1

existsMethod · 0.80

Tested by

no test coverage detected