ugorsahin/TalkingHeads

Consider using find_chrome_executable from undetected_chromedriver in detect_chrome_version

Closed this issue · 0 comments

On mac, I don't think google-chrome is normally added to path. undetected-chromedriver has a function find_chrome_executable that looks designed to find chrome in a way that supports more platform way; consider using that.

dev/TalkingHeads/src/talkingheads/utils.py", line 36, in detect_chrome_version
    out = subprocess.check_output(['google-chrome', '--version'])
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/Cellar/python@3.11/3.11.5/Frameworks/Python.framework/Versions/3.11/lib/python3.11/subprocess.py", line 466, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/Cellar/python@3.11/3.11.5/Frameworks/Python.framework/Versions/3.11/lib/python3.11/subprocess.py", line 548, in run
    with Popen(*popenargs, **kwargs) as process:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/Cellar/python@3.11/3.11.5/Frameworks/Python.framework/Versions/3.11/lib/python3.11/subprocess.py", line 1026, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/local/Cellar/python@3.11/3.11.5/Frameworks/Python.framework/Versions/3.11/lib/python3.11/subprocess.py", line 1950, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'google-chrome'

from undetected_chromedriver import find_chrome_executable
find_chrome_executable()
'/Applications/Google Chrome.app/Contents/MacOS/Google Chrome'