Comments (6)
Is it on GitHub bro
from whatsapp-bulk-messenger.
yes i have the same problem i tried switching the class name and also tried xpath but the problem remains . has anyone found any solution to this
from whatsapp-bulk-messenger.
Install pyautogui
and change the automator.py code to:-
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
from webdriver_manager.chrome import ChromeDriverManager
from time import sleep
from urllib.parse import quote
import os
import pyautogui
options = Options()
options.add_experimental_option("excludeSwitches", ["enable-logging"])
options.add_argument("--profile-directory=Default")
# options.add_argument("--user-data-dir=/var/tmp/chrome_user_data")
os.system("")
os.environ["WDM_LOG_LEVEL"] = "0"
class style():
BLACK = '\033[30m'
RED = '\033[31m'
GREEN = '\033[32m'
YELLOW = '\033[33m'
BLUE = '\033[34m'
MAGENTA = '\033[35m'
CYAN = '\033[36m'
WHITE = '\033[37m'
UNDERLINE = '\033[4m'
RESET = '\033[0m'
print(style.BLUE)
print("**********************************************************")
print("**********************************************************")
print("***** ******")
print("***** THANK YOU FOR USING WHATSAPP BULK MESSENGER ******")
print("***** This tool was built by Anirudh Bagri ******")
print("***** www.github.com/anirudhbagri ******")
print("***** ******")
print("**********************************************************")
print("**********************************************************")
print(style.RESET)
f = open("message.txt", "r")
message = f.read()
f.close()
print(style.YELLOW + '\nThis is your message-')
print(style.GREEN + message)
print("\n" + style.RESET)
message = quote(message)
numbers = []
f = open("numbers.txt", "r")
for line in f.read().splitlines():
if line.strip() != "":
numbers.append(line.strip())
f.close()
total_number = len(numbers)
print(style.RED + 'We found ' + str(total_number) +
' numbers in the file' + style.RESET)
delay = 30
driver = webdriver.Chrome(ChromeDriverManager().install(), options=options)
print('Once your browser opens up sign in to web whatsapp')
driver.get('https://web.whatsapp.com')
input(style.MAGENTA + "AFTER logging into Whatsapp Web is complete and your chats are visible, press ENTER..." + style.RESET)
for idx, number in enumerate(numbers):
number = number.strip()
if number == "":
continue
print(style.YELLOW + '{}/{} => Sending message to {}.'.format((idx+1),
total_number, number) + style.RESET)
try:
url = 'https://web.whatsapp.com/send?phone=' + number + '&text=' + message
sent = False
for i in range(3):
if not sent:
driver.get(url)
sleep(15)
sent = True
pyautogui.press('enter')
# try:
# click_btn = WebDriverWait(driver, delay).until(
# EC.element_to_be_clickable((By.XPATH, "//button[@class='_4sWnG']")))
# except Exception as e:
# print(
# style.RED + f"\nFailed to send message to: {number}, retry ({i+1}/3)")
# print(
# "Make sure your phone and computer is connected to the internet.")
# print("If there is an alert, please dismiss it." + style.RESET)
# else:
# sleep(1)
# click_btn.click()
# sent = True
# sleep(3)
# print(style.GREEN + 'Message sent to: ' +
# number + style.RESET)
except Exception as e:
print(style.RED + 'Failed to send message to ' +
number + str(e) + style.RESET)
driver.close()
from whatsapp-bulk-messenger.
bro i have made an update to your code . check it out here : https://github.com/akhilrajs/Whatsapp-messaging-BOT
from whatsapp-bulk-messenger.
Please fixed the sending button not working function
from whatsapp-bulk-messenger.
button and list message only work at official api
from whatsapp-bulk-messenger.
Related Issues (20)
- Ban HOT 5
- Sending images HOT 3
- adding group HOT 2
- Bypass if a number is not active HOT 5
- Class button send HOT 1
- Alright | Give it a try HOT 1
- Message showing up in the text box but doesn't get sent; Python throws the error
- could not get version for chrome with this command reg query HOT 1
- How Add Image In Message HOT 3
- License
- Traceback issue on webdriver chrome HOT 2
- Adding media HOT 2
- Failed to send message to 'phone-number' HOT 2
- Bug fix of binary file of chrome and emoji support issue HOT 1
- invalid number HOT 1
- what if the number is not valide ? HOT 3
- Messages not sending HOT 7
- Chats not visible HOT 7
- How to send an image using the programe HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from whatsapp-bulk-messenger.