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/update/critical: Fix 'WebDriver.__init__() got multiple values for argument' ERROR. #152

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
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
23 changes: 12 additions & 11 deletions alright/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
allowing you to send messages, images, video and documents programmatically using Python
"""


import os
import sys
import time
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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,
}
)
Expand All @@ -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,
}
)
Expand All @@ -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,
}
)
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
],
install_requires=[
"platformdirs",
"selenium",
"selenium==4.2.0",
"webdriver-manager",
],
include_package_data=False,
Expand Down