Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for chrome binary not found error and also works for chromium based base browser #43

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions chat.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down