So, this Whatsapp just irritates my dad.
Starting with my dad who is a business man and who gives loan to few people. Now, for asking them to pay EMI, he does this long process:
Save PhoneNumber -> Open Whatsapp -> Check if phone Number exist on Whatsapp -> Open Number -> Paste the already copied message -> Click send button.
Total time wasted for each message — approx 40–50 seconds.
Now, there exist a WhatsApp API which made me think if this whole messaging could be automated???
Lets jump to the chase:
This is the exact link which can be used to send number to anyone in the world if he/she exists on whatsapp:
https://wa.me/<number>?text=<text message>
Yehhh, I just found a way to automate, I will just loop up the link with a new number each time.
Now comes a burst of problems doing this…
So, these challenges had to be sorted out before launching this script.
Let us solve the problems now one by one, one by one…
driver.get("https://web.whatsapp.com/send?phone="+str(i)")
input_box = driver.find_element_by_xpath('//[@id="main"]/footer/div[1]/div[2]/div/div[2]')
for j in messages:
input_box.send_keys(j)
Ok, now I have successfully entered the message in the text box, but clicking the button using selenium wasn’t happening, atleast I failed to do so. If any of the readers are able to, just comment below.
Hence, I used a simple technique which is clicking enter after the message is entered in the text box and the modified code looked something like this:
Yehhhh, now the message is sent successfully to the number specified. The only thing now left to do is loop withing the list of Phone Numbers and I think showing how to write a for loop will be waste of time and space.
Lucky us, once we scan the QR code, when the next link opens in a new window it won’t ask for it again. Hopefully WhatsApp doesn’t fix that.
I think this is it, messaging bulk on whatsapp just became easier and hence, I thought of releasing a library and it is called Whatsall and the full code can be seen here.
I think now anyone can use this to send messages in bulk. Huhh problem solved, but…
Again a list of problems come up:
And all I wanted to do was to make my dad’s work easier but it still remains the same. Hence, I decided to make an app
This app should be in such a way that it solves the above three problems. And well well well, it just addressed all the above problems and the code of the app is another time’s story. Until then just use my app.
Link for the app: https://play.google.com/store/apps/details?id=com.divesh.whatsall.automessenger_free
Please copy the link - most likely the link get altered here...
I guess that’s it for this particular blog. If you liked it, give it a thumbs up and in the next blog we will see how to make the whatsapp automation app.
Thank you…