[Python] Whatsapp Bot giving errors

Discussão em 'Python' iniciado por Stack, Fevereiro 25, 2025.

  1. Stack

    Stack Membro Participativo

    while True: try: # Wait for the message input box to appear msg_box = wait.until(EC.presence_of_element_located((By.XPATH, "//div[contains(@class, 'selectable-text copyable-text')]")))

    # Type and send the message
    msg_box.send_keys(message)
    msg_box.send_keys(Keys.ENTER) # Press Enter to send
    print("Message sent!")

    # Wait for 15 seconds before sending the next message
    time.sleep(15)

    except Exception as e:
    print(f"An error occurred: {e}")
    break # Exit the loop on error


    I am using selenium package But I am getting error on running code

    Error:

    Scan QR code and press Enter...
    Logged in successfully.
    Searching for group...
    Group 'Young Thugs United' found. Sending messages every 15 seconds...


    An error occurred: Message:

    I want it to send message automatically Please help

    Continue reading...

Compartilhe esta Página