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, } ) 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,