Skip to content

Instantly share code, notes, and snippets.

@vmesel
Created August 24, 2018 17:30
Show Gist options
  • Save vmesel/4bef2b4fd00bbc232c3bc1a585dac919 to your computer and use it in GitHub Desktop.
Save vmesel/4bef2b4fd00bbc232c3bc1a585dac919 to your computer and use it in GitHub Desktop.
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
driver = webdriver.Firefox()
driver.get("http://web.whatsapp.com")
qr_code = WebDriverWait(driver, 60).until(
EC.element_to_be_clickable((By.XPATH, "/html/body/div/div/div/div[2]/div[1]/div[2]/div/img"))
)
print(qr_code.get_attribute("src"))
driver.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment