From 12df9265579548f7bf55b0ffa279451153b03414 Mon Sep 17 00:00:00 2001 From: savitha Date: Wed, 1 Sep 2021 19:14:36 +0530 Subject: [PATCH 1/2] fixes issue: chrome binary not found and also works for chromium based browsers --- chat.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/chat.py b/chat.py index e9ce5e6..0f55fb1 100644 --- a/chat.py +++ b/chat.py @@ -16,6 +16,8 @@ from selenium.common.exceptions import WebDriverException as WebDriverException config = { + #whatsapp web for chromium based browsers. I used brave here. Replace with yours + 'chromium_binary' : '{0}/bin/brave'.format(os.environ('HOME')), 'chromedriver_path': "{0}/bin/chromedriver".format(os.environ['HOME']), 'get_msg_interval': 5, # Time (seconds). Recommended value: 5 'colors': True, # True/False. True prints colorful msgs in console @@ -53,6 +55,8 @@ def main(): os.makedirs(chrome_data_dir_directory) driver_options = webdriver.ChromeOptions() + #important step: link the browser's install location + driver_options.binary_location = config['chromium_binary'] driver_options.add_argument("user-data-dir={0}".format(chrome_data_dir_directory)) # add proxy capability From c3cf8d4efc6b4a26ac89ebc36217a5e68d4820cb Mon Sep 17 00:00:00 2001 From: savitha Date: Wed, 1 Sep 2021 19:24:15 +0530 Subject: [PATCH 2/2] fixed a typo --- chat.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chat.py b/chat.py index 0f55fb1..5391aa8 100644 --- a/chat.py +++ b/chat.py @@ -17,7 +17,7 @@ config = { #whatsapp web for chromium based browsers. I used brave here. Replace with yours - 'chromium_binary' : '{0}/bin/brave'.format(os.environ('HOME')), + 'chromium_binary' : '{0}/bin/brave'.format(os.environ['HOME']), 'chromedriver_path': "{0}/bin/chromedriver".format(os.environ['HOME']), 'get_msg_interval': 5, # Time (seconds). Recommended value: 5 'colors': True, # True/False. True prints colorful msgs in console