Rotten-Scripts icon indicating copy to clipboard operation
Rotten-Scripts copied to clipboard

Fatal SyntaxError on Launch, Hardcoded User Path, and Deprecated Selenium Locators in WhatsApp Message Automation

Open codeCraft-Ritik opened this issue 2 months ago • 1 comments

Is there an existing issue for this?

  • [x] I have searched the existing issues.

Current Behavior

1. Current Behavior

When attempting to run Python/WhatsApp_Message_Automation/whatsapp_message_automation.py, the script fails to execute immediately due to three primary issues:

  1. Fatal SyntaxError on Launch (Line 10): The variable name twenty-five uses a hyphen (-). In Python syntax, - is treated as a subtraction operator rather than a valid identifier character. The interpreter crashes during the AST parsing phase before executing any code:
      File "Python/WhatsApp_Message_Automation/whatsapp_message_automation.py", line 10
        twenty-five = 25
        ^^^^^^^^^^^
    SyntaxError: cannot assign to expression here. Maybe you meant '==' instead of '='?
    
    

Expected Behavior

Expected Behavior

  • The script should compile and execute cleanly without any syntax errors across all supported Python 3.x versions.
  • ChromeDriver initialization should be dynamic and portable (leveraging system PATH, webdriver-manager, or dynamic CLI/argument options) without hardcoding private user file paths.
  • Element locators should use standard, modern Selenium 4 driver.find_element(By.XPATH, ...) syntax.
  • The script should provide clear console prompts and structured error handling for WhatsApp Web QR authentication and chat interactions.

To Reproduce

3. To Reproduce

A. Environment Setup & Prerequisites

Ensure Python 3.8+ and standard dependencies are installed on the testing environment:

# Clone the repository
git clone https://github.com/HarshCasper/Rotten-Scripts.git
cd Rotten-Scripts/Python/WhatsApp_Message_Automation

# Install required Selenium package
pip install selenium

### Anything else?

- Operating System: Cross-platform (Windows / macOS / Linux)
- Python Version Tested: Python 3.8 / 3.9 / 3.10 / 3.11 / 3.12
- Selenium Version: Selenium 4.x+
- Impact: Fixing this makes the script fully functional, cross-platform compatible, and ready for modern Python/Selenium environments.
- Contribution: I have already analyzed and tested the fix locally. Could you please assign this issue to me so I can submit a clean, well-tested Pull Request?

### Code of Conduct

- [x] I agree to follow this project's Code of Conduct

codeCraft-Ritik avatar Sep 09 '26 03:09 codeCraft-Ritik

@codeCraft-Ritik Welcome to Rotten-Scripts🥳 Thanks for opening this Issue 🙌, This Will definitely Improve our Project💖.While we are having a look at this. If you want to work on this then,feel free to self-assign and start working on it.📄 Use /assign to self-assign this issue.

github-actions[bot] avatar Sep 09 '26 03:09 github-actions[bot]