From 9674586ec632bcdf8c5d564b67f2b04b0f1b6a1e Mon Sep 17 00:00:00 2001 From: Nitkarsh Chourasia Date: Sat, 13 Apr 2024 06:35:31 +0530 Subject: [PATCH 1/2] fix/update: Fix 'WebDriver.__init__() got multiple values for argument' ERROR. --- alright/__init__.py | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/alright/__init__.py b/alright/__init__.py index 184174d..c9d5d0f 100644 --- a/alright/__init__.py +++ b/alright/__init__.py @@ -3,7 +3,6 @@ allowing you to send messages, images, video and documents programmatically using Python """ - import os import sys import time @@ -36,9 +35,11 @@ def __init__(self, browser=None, time_out=600): self.suffix_link = "https://web.whatsapp.com/send?phone={mobile}&text&type=phone_number&app_absent=1" if not browser: + chrome_options = Options() + # Add any desired options here browser = webdriver.Chrome( ChromeDriverManager().install(), - options=self.chrome_options, + options=chrome_options, ) handles = browser.window_handles @@ -333,9 +334,9 @@ def get_list_of_messages(self): "time": _message[1], "message": _message[2], "unread": _message[-1].isdigit(), - "no_of_unread": int(_message[-1]) - if _message[-1].isdigit() - else 0, + "no_of_unread": ( + int(_message[-1]) if _message[-1].isdigit() else 0 + ), "group": False, } ) @@ -346,9 +347,9 @@ def get_list_of_messages(self): "time": _message[1], "message": "", "unread": _message[-1].isdigit(), - "no_of_unread": int(_message[-1]) - if _message[-1].isdigit() - else 0, + "no_of_unread": ( + int(_message[-1]) if _message[-1].isdigit() else 0 + ), "group": True, } ) @@ -359,9 +360,9 @@ def get_list_of_messages(self): "time": _message[1], "message": _message[4], "unread": _message[-1].isdigit(), - "no_of_unread": int(_message[-1]) - if _message[-1].isdigit() - else 0, + "no_of_unread": ( + int(_message[-1]) if _message[-1].isdigit() else 0 + ), "group": True, } ) From 8a67708b6df2e6e35e00737fa2e823e86b2b37a5 Mon Sep 17 00:00:00 2001 From: Nitkarsh Chourasia Date: Sat, 13 Apr 2024 06:50:26 +0530 Subject: [PATCH 2/2] fix/critical: Install Correct Seleniumfor dependency breaks. --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 74e21d5..3d7353a 100644 --- a/setup.py +++ b/setup.py @@ -28,7 +28,7 @@ ], install_requires=[ "platformdirs", - "selenium", + "selenium==4.2.0", "webdriver-manager", ], include_package_data=False,