Package: autowhatspy
AutoWhatsPyWhatsApp and Email Automation with PythonIt does not open any browser window while sending messages through WhatsApp. It works completely in the background.This package is to be used for educational and testing purposes only. Don't use this package to spam people.If anyone uses this to spam people, I will not be responsible.I created this just for educational purposes to help the learners get a better understanding of selenium.AuthorCreated by Samrat DuttaGithub:https://github.com/SamratDuttaOfficialLinkedin:https://www.linkedin.com/in/SamratDuttaOfficial/GithubPlease visit the Github repository for a quick tutorial.https://github.com/SamratDuttaOfficial/autowhatspyPull requests are always welcome.FeaturesSend text and image messages through WhatApp to unlimited numbers/contacts/groups.Send emails to multiple email addresses through your email client.It does not open any browser window while sending messages through WhatsApp. It works completely in the background.TechThis package is completely built with python.PackagesHere are some packages you'll need to run this package.Selenium - For the webdriverPyperclip - To copy and paste text. (not used in this version)OthersGechodriver- Firefox driver for SeleniumInstallationIt works best with python 3.9 or above and the latest version of pip to install this package.pipinstallautowhatspyTo update the package (if a new version is there)pipinstallautowhatspy--upgradeUsageFor WhatsAppFunctionsBulk WhatsApp messages to numbersTo send a single text or image (or both) message to multiple numbers through WhatsApp. This will work even if the numbers are not saved in your contacts. This will work even if you have never messaged the numbers from your WhatsApp. This will not work for a number which is not registered or active on WhatsApp.message_to_numbers(msg,numbers_list,gechodriver,gechodriver_log,user_profile,country_code,image)Bulk WhatsApp messages to contactsTo send a single text or image (or both) message to multiple contacts through WhatsAppmessage_to_contacts(msg,contacts,gechodriver,gechodriver_log,user_profile,image)Bulk WhatsApp messages to groupsTo send a single text or image (or both) message to multiple groups through WhatsApp. You have to be a member of the groups with permission to send messages.message_to_groups(msg,groups,gechodriver,gechodriver_log,user_profile,image)Argumentsmsg- Path to the text file containing the message text.Do not use unnecessary new lines in the text as they will be sent as separate messages to the receipients.numbers_list- Path to the text file containing the list of numbers.The contents of the text file should be like this:919836xxxx10
9624xxxx78
919745xxxx69
7898xxxx56
8985xxxx65The numbers may or may not have a country code attached to it. It will work either way.contacts- Path to the text file containing the list of contacts.The contents of the text file should be like this:SamratDutta
AbrahamLincoln
Sachin
Sourav
Mr.DasThe names in the text file should be exactly same as they are saved in your phone. You must be already talking to them on WhatsApp.groups- Path to the text file containing the list of groups.The contents of the text file should be like this:GroupOne
GroupTwo
PersonalGroup
FamilyGroup
WorkGroupThe group names in the text file should be exactly same as they are in your WhatsApp (case-sensitive). You have to be a member of the groups with permission to send messages.country_code- The country code of the numbers, without any symbols. Example: 91gechodriver- Path to the gechodriver.exe file.Download the gechodriver.exe (link above) and send the path as an argument. You may use the absolute path or the relative path based on how your interpreter works.Make sure gechodriver.exe is in the same project folder you are working on. Or add the folder where gechodriver.exe is located in the PATH. Otherwise, an error might occur.gechodriver_log- Path to the text file where the logs of gechodriver will be saved.Make sure gechodriver.log is in the same project folder you are working on. Otherwise, an error might occur.user_profile- Path to the saved firefox user profile.Open firefox. Go to about:profiles and make a new profile.Save it in your project directory with whatever name firefox assigns it.Open that profile, open web.whatsapp.com and scan the QR.Send the path of the profile as the argument to the function.image- (Optional) Path to the image/video you want to send. Make sure that it is supported by WhatsApp and is of the permissible length.For EmailFunctionsBulk WhatsApp messages to groupsTo send test based email to multiple email addresses.send_emails(_smtp,msg,address_list,subject,your_email_address,passwrd)Arguments_smtp- SMTP server address of you email client. I used smtp.gmail.com:587 for Gmail in my experimentsGmail SMTP server address: smtp.gmail.comGmail SMTP name: Your full nameGmail SMTP username: Your full Gmail address (e.g.you@gmail.com)Gmail SMTP password: The password that you use to log in to GmailGmail SMTP port (TLS): 587Gmail SMTP port (SSL): 465Note: You can use the SMTP server even if you’ve enabled two-factor authentication on your Google account. However, you will need to generate an app password so that the app can still connect.msg- Path to the text file containing the message text.address_list- Path to the text file containing the list of email addresses.The contents of the text file should be like this:samxxxxxx@gxxx.com
somxxxxxx@yaxxx.com
johnxxxxx@mailxxxxx.comsubject- Subject of the email you are sending.your_email_address- Your email address associated with the email client you are using.passwrd- Password of the email address you are using.NoteMake sure the number of emails in the list does not exceed your daily/monthly limit.For Gmail: With just a free Gmail account, you’ll be able to send up to 500 emails per day. If you have a paid Google Workspace account, your limit is 2,000 emails per day. The limits apply to a “rolling 24 hour period”.If the program fails to send emails to all the given email addresses, check your own email address and password. Also check if your daily limit is exceeded or not.LicenseMIT