Last active
April 30, 2022 02:00
-
-
Save jimmykhlam/776952db7a3b21a274c95ae907367353 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from selenium import webdriver | |
from selenium.common.exceptions import TimeoutException | |
from selenium.webdriver.chrome.options import Options | |
from selenium.webdriver.common.keys import Keys | |
from selenium.webdriver.common.by import By | |
from selenium.webdriver.support.ui import WebDriverWait | |
from selenium.webdriver.support import expected_conditions as EC | |
from selenium.webdriver.support.ui 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) | |
driver.get('https://web.whatsapp.com/') | |
#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) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is a code section from this: https://github.com/jimmykhlam/whatsapp-web-automation