Last active
May 11, 2022 19:58
-
-
Save thepycoach/6c520717863d629d49ff25911403a028 to your computer and use it in GitHub Desktop.
This file contains hidden or 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.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