title: WhatsApp Web automation with Selenium not working
body: <p>I found <a href="https://github.com/nosaevb/python-and-selenium-automate-whatsapp-web/blob/master/py_selenium_ian.py" rel="nofollow noreferrer">this python script on github</a> that sends automatic WhatsApp Web messages through Selenium. </p>
  
  <pre><code>#https://www.github.com/iamnosa
  #Let's import the Selenium package
  from selenium import webdriver
  
  #Let's use Firefox as our browser
  web = webdriver.Firefox()
  web.get('http://web.whatsapp.com')
  input()
  
  #Replace Mr Kelvin with the name of your friend to spam
  elem = web.find_element_by_xpath('//span[contains(text(),"Mr Kelvin")]')
  elem.click()
  elem1 = web.find_elements_by_class_name('input')
  while True:
      elem1[1].send_keys('hahahahahahaha')
  web.find_element_by_class_name('send-container').click()
  </code></pre>
  
  <p>Even though it was meant for spamming, I was trying to adapt it for a good purpose, but the script as it stands doesn't seem to work. Instead of sending a message through WhatsApp Web, it simply loads a QR authentication screen and then it does nothing after I authenticate with my cellphone.</p>
  
  <p>Any clue as to why this is happening? I'm running the lastest version of Selenium WebDriver on Firefox and geckodriver has already been extracted to /usr/bin/.</p>