Skip to content

Instantly share code, notes, and snippets.

Last active April 30, 2022 02:00
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save jimmykhlam/776952db7a3b21a274c95ae907367353 to your computer and use it in GitHub Desktop.
from selenium import webdriver
from selenium.common.exceptions import TimeoutException
from import Options
from selenium.webdriver.common.keys import Keys
from import By
from import WebDriverWait
from import expected_conditions as EC
from import Select
from selenium.webdriver.common.action_chains import ActionChains
from datetime import datetime
import time
chrome_options = Options()
driver = webdriver.Chrome(options=chrome_options)
#wait 60 secs to allow for the user to manually scan the Whatsapp Web QR code to log on
el_side = WebDriverWait(driver, 60).until(EC.element_to_be_clickable((By.ID, "side")))
#locate the search box
el_search = el_side.find_element(By.XPATH, "//div[contains(@title, 'Search')]")
print("Logged in and located search box:", el_search)
Copy link

This is a code section from this:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment