Demon_connect icon indicating copy to clipboard operation
Demon_connect copied to clipboard

Error name 'Service' is not defined

Open muhbianco opened this issue 1 year ago • 4 comments

📝 Describe the bug

Traceback (most recent call last): File "D:\playwrite_project\demon.py", line 7, in whatsapp_demon.login() File "D:\playwrite_project\venv\Lib\site-packages\demon_connect\whatsapp_api.py", line 156, in login login_whatsapp(self) File "D:\playwrite_project\venv\Lib\site-packages\demon_connect\features\login\login_whatsapp.py", line 30, in login_whatsapp self.driver = webdriver.Chrome(service=Service(), options=self._chrome_options) ^^^^^^^ NameError: name 'Service' is not defined

🔄 To Reproduce

from demon_connect.whatsapp_api import Demon

Initialize the API

whatsapp_demon = Demon()

Log in to WhatsApp Web

whatsapp_demon.login()

# Send a message

message = "heyy"

contact = "Grp"

whatsapp_demon.send_message(contact,message)

whatsapp_demon.delete_message(contact,message)

# Send an image (provide the path to the image file)

image_path = r"C:\Users\raman\Downloads\aatman.jpg"

contact = "Grp"

whatsapp_demon.send_image(contact,image_path)

# Send a video (provide the path to the video file)

video_path = "path/to/your/video.mp4"

whatsapp_demon.send_video(contact,video_path)

# tag all in group

group_name = "Grp"

whatsapp_demon.tag_all(group_name)

@whatsapp_demon.event def on_message(chat): print(f"New message from {chat.name}: {chat.message}")

@whatsapp_demon.event def on_ready(): print("Demon is ready!")

chat = whatsapp_demon.open("Anupam Maurya")

chat.send("HI")

🚀 Expected behavior

No response

🌟 pywa version

No response

🐍 Python version

No response

💻 Operating System

No response

📚 Additional context

No response

muhbianco avatar Nov 15 '23 18:11 muhbianco