From 90dd123cb0154bba79bc006dd3c3bcf90ccb9fb1 Mon Sep 17 00:00:00 2001 From: s_falahati Date: Fri, 26 Apr 2019 03:44:56 +0430 Subject: [PATCH 1/7] ChromeDriver added to the gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index e93ad28..20cf15b 100644 --- a/.gitignore +++ b/.gitignore @@ -104,3 +104,4 @@ venv.bak/ .mypy_cache/ /ChromeProfile* /Work/* +/chromedriver* From 46c236fd5cef13a0605b65618a1ec87f68600d65 Mon Sep 17 00:00:00 2001 From: s_falahati Date: Mon, 6 May 2019 17:28:36 +0430 Subject: [PATCH 2/7] Cleanup --- .gitignore | 2 +- .gitmodules | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 .gitmodules diff --git a/.gitignore b/.gitignore index 20cf15b..2cafc54 100644 --- a/.gitignore +++ b/.gitignore @@ -100,7 +100,7 @@ venv.bak/ # mkdocs documentation /site -# mypy +# PyWhatsAppWeb .mypy_cache/ /ChromeProfile* /Work/* diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..da396f2 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "pyautoit"] + path = pyautoit + url = https://github.com/jacexh/pyautoit.git From 13acf5e7ce3cd3459c825701c64292fdc53576ae Mon Sep 17 00:00:00 2001 From: s_falahati Date: Thu, 26 Sep 2019 15:32:00 +0330 Subject: [PATCH 3/7] Fixed a problem with new WhatsApp application advertisement page while redirecting from contact share link --- PyWhatsAppWeb.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/PyWhatsAppWeb.py b/PyWhatsAppWeb.py index c045baa..0818e80 100644 --- a/PyWhatsAppWeb.py +++ b/PyWhatsAppWeb.py @@ -477,6 +477,9 @@ def whatsAppOpenContact(phoneNumber, alertTimeout=120, redirectTimeout=45): i = 0 while True: + if (domDoesElementExists('//a[@class="action__link"][text()=\'use WhatsApp Web\']')): + domWaitForElementClick('//a[@class="action__link"][text()=\'use WhatsApp Web\']', 3) + time.sleep(1) if (domDoesElementExists('//*[@id="main"]/footer/div[1]/div[2]/div/div[2]')): return True, False else: From b37d6a5c7befe5519a0fa1c5668ec99fdc64493c Mon Sep 17 00:00:00 2001 From: s_falahati Date: Thu, 14 Nov 2019 15:49:28 +0330 Subject: [PATCH 4/7] Fixed a problem with changes to the HTML of the WA application advertisement link --- PyWhatsAppWeb.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PyWhatsAppWeb.py b/PyWhatsAppWeb.py index 0818e80..b7a7dd2 100644 --- a/PyWhatsAppWeb.py +++ b/PyWhatsAppWeb.py @@ -477,8 +477,8 @@ def whatsAppOpenContact(phoneNumber, alertTimeout=120, redirectTimeout=45): i = 0 while True: - if (domDoesElementExists('//a[@class="action__link"][text()=\'use WhatsApp Web\']')): - domWaitForElementClick('//a[@class="action__link"][text()=\'use WhatsApp Web\']', 3) + if (domDoesElementExists('//a[@class="_36or"][text()=\'use WhatsApp Web\']')): + domWaitForElementClick('//a[@class="_36or"][text()=\'use WhatsApp Web\']', 3) time.sleep(1) if (domDoesElementExists('//*[@id="main"]/footer/div[1]/div[2]/div/div[2]')): return True, False From cd82406831d25d4f64483eac465be7cf19d57fac Mon Sep 17 00:00:00 2001 From: s_falahati Date: Thu, 30 Jan 2020 18:57:53 +0330 Subject: [PATCH 5/7] Fixed a problem with media send button not getting recognized with the latest version of WApp for web --- PyWhatsAppWeb.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PyWhatsAppWeb.py b/PyWhatsAppWeb.py index b7a7dd2..16b4930 100644 --- a/PyWhatsAppWeb.py +++ b/PyWhatsAppWeb.py @@ -635,7 +635,7 @@ def whatsAppSendMedia(fileName, caption=False): # Clicking send writeConsole("Sending ...") - if (domWaitForElementClick('//*[@id="app"]/div/div/div[2]/div[2]/span/div/span/div/div/div[2]/span[2]/div/div/span') == False): + if (domWaitForElementClick('//*[@id="app"]/div/div/div[2]/div[2]/span/div/span/div/div/div[2]/span/div/div/span') == False): writeConsole("Failed to attach media.") return False From 5598cef510597e329a495c3f2af1fb0a7eb5b231 Mon Sep 17 00:00:00 2001 From: s_falahati Date: Sat, 18 Apr 2020 21:36:36 +0430 Subject: [PATCH 6/7] readme updated --- README.md | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 8197046..7242ff6 100644 --- a/README.md +++ b/README.md @@ -22,21 +22,21 @@ This project provides the following features: And includes an example which sends the files located in the *'Work'* folder. Read more below. -## WHERE TO DOWNLOAD +## How to get You need to clone or download this project using the top right green button. -## Donation -Donations assist development and are greatly appreciated; also always remember that [every coffee counts!](https://media.makeameme.org/created/one-simply-does-i9k8kx.jpg) :) +## Help me fund my own Death Star [![](https://img.shields.io/badge/crypto-CoinPayments-8a00a3.svg?style=flat-square)](https://www.coinpayments.net/index.php?cmd=_donate&reset=1&merchant=820707aded07845511b841f9c4c335cd&item_name=Donate¤cy=USD&amountf=20.00000000&allow_amount=1&want_shipping=0&allow_extra=1) [![](https://img.shields.io/badge/shetab-ZarinPal-8a00a3.svg?style=flat-square)](https://zarinp.al/@falahati) +[![](https://img.shields.io/badge/usd-Paypal-8a00a3.svg?style=flat-square)](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=ramin.graphix@gmail.com&lc=US&item_name=Donate&no_note=0&cn=&curency_code=USD&bn=PP-DonationsBF:btn_donateCC_LG.gif:NonHosted) **--OR--** You can always donate your time by contributing to the project or by introducing it to others. -## HOW TO USE +## How to use 1. Install **Python 2.7+** or **Python 3+** 2. Install **Selenium** by executing `pip install selenium` 4. Install **PyAutoIt** by navigating to the 'pyautoit' folder and executing `python setup.py install` @@ -53,7 +53,9 @@ You can always donate your time by contributing to the project or by introducing * Attachments are only available when executed under Windows; this is due to using **AutoIt** for selecting the attachment file. * To close the program you need to press `CTRL`+`C` two times; last one being in the "Waming-Up..." stage as the code runs in a loop. -## LICENSE -Copyright (C) 2019 Soroush Falahati +## License +Copyright (C) 2019-2020 Soroush Falahati -Released under the Apache-2.0 license \ No newline at end of file +Released under the Apache-2.0 license + +Idea and project fundation from [@shauryauppal's PyWhatsapp](https://github.com/shauryauppal/PyWhatsapp) \ No newline at end of file From 15e8edcf086b6f2b0bcb23e67740750d87b2f82f Mon Sep 17 00:00:00 2001 From: s_falahati Date: Thu, 11 Feb 2021 13:07:00 +0330 Subject: [PATCH 7/7] fixed a problem regarding the attachment button position in latest update --- PyWhatsAppWeb.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/PyWhatsAppWeb.py b/PyWhatsAppWeb.py index 16b4930..8a46888 100644 --- a/PyWhatsAppWeb.py +++ b/PyWhatsAppWeb.py @@ -592,7 +592,7 @@ def whatsAppSendMedia(fileName, caption=False): try: # Attachment drop down menu. writeConsole("Attaching ...") - if (domWaitForElementClick('//*[@id="main"]/header/div[3]/div/div[2]/div/span') == False): + if (domWaitForElementClick('//*[@id="main"]/footer/div[1]/div[1]/div[2]/div/div/span') == False): writeConsole("Failed to attach media.") return False @@ -600,7 +600,7 @@ def whatsAppSendMedia(fileName, caption=False): # Attach videos and images. writeConsole("Attaching media ...") - if (domWaitForElementClick('//*[@id="main"]/header/div[3]/div/div[2]/span/div/div/ul/li[1]/button') == False): + if (domWaitForElementClick('//*[@id="main"]/footer/div[1]/div[1]/div[2]/div/span/div/div/ul/li[1]/button') == False): writeConsole("Failed to attach media.") return False @@ -658,7 +658,7 @@ def whatsAppSendFile(fileName): try: # Attachment drop down menu. writeConsole("Attaching ...") - if (domWaitForElementClick('//*[@id="main"]/header/div[3]/div/div[2]/div/span') == False): + if (domWaitForElementClick('//*[@id="main"]/footer/div[1]/div[1]/div[2]/div/div/span') == False): writeConsole("Failed to attach file.") return False @@ -666,7 +666,7 @@ def whatsAppSendFile(fileName): # Attach file and document. writeConsole("Attaching file ...") - if (domWaitForElementClick('//*[@id="main"]/header/div[3]/div/div[2]/span/div/div/ul/li[3]/button') == False): + if (domWaitForElementClick('//*[@id="main"]/footer/div[1]/div[1]/div[2]/div/span/div/div/ul/li[3]/button') == False): writeConsole("Failed to attach file.") return False