Skip to content

Instantly share code, notes, and snippets.

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

  • Save thepycoach/6c520717863d629d49ff25911403a028 to your computer and use it in GitHub Desktop.

Select an option

Save thepycoach/6c520717863d629d49ff25911403a028 to your computer and use it in GitHub Desktop.
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
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
options = Options()
options.add_experimental_option("debuggerAddress", "localhost:9222")
service = Service(executable_path=path)
driver = webdriver.Chrome(service=service, options=options)
driver.get(website)
driver.maximize_window()
time.sleep(4) # time to load all the content
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment