I have WhatsApp Web working on Rasp Pi. I use Chromium and the ChromiumDriver.
First install the Chromium Browser and WebDriver. Copy the below in your Terminal.
sudo apt-get install chromium-chromedriver
Here is my Python code:
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
import time
options = Options()
options.add_argument("--user-data-dir=chrome-data") #this is needed to stop WhatsApp asking for QR code verification after your first time
options.add_experimental_option("excludeSwitches", ["enable-automation"])
options.add_experimental_option('useAutomationExtension', False)
driver = webdriver.Chrome('/usr/lib/chromium-browser/chromedriver', options=options)
driver.maximize_window()
driver.get('https://web.whatsapp.com')
time.sleep(10)
driver.find_element_by_xpath("//[@title='REMOVED']").click() #change Removed to the number of group you are sending a message to
driver.find_element_by_xpath('//[@id="main"]/footer/div[1]/div[2]/div/div[2]').send_keys('MESSAGE HERE')
driver.find_element_by_xpath('//*[@id="main"]/footer/div[1]/div[3]/button/span').click()
time.sleep(5)
I have only found one error and forward slashes will not send. Here is my Stack Overflow post about it. I found your post while trying to resolve my error.
Please note I am on a Raspberry 4 and I'm not 100% sure if it will work on Raspberry 3.