Skip to content

Instantly share code, notes, and snippets.

@thepycoach
Last active May 11, 2022 19:02
Show Gist options
  • Select an option

  • Save thepycoach/0ac9cd622286b59e89ffad16df5ab220 to your computer and use it in GitHub Desktop.

Select an option

Save thepycoach/0ac9cd622286b59e89ffad16df5ab220 to your computer and use it in GitHub Desktop.
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
import time
path = # path of your chromedriver file
website = "https://web.whatsapp.com/"
phone_number = # Write a phone number here
photo_path = # paste the path of the photo you want to send here
service = Service(executable_path=path)
driver = webdriver.Chrome(service=service)
driver.get(website)
driver.maximize_window()
time.sleep(30) # scan QR code (we don't need to wait that much when we open existing browser)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment