Python – Login WordPress Using Selenium

from selenium import webdriver
from shutil import which
import time

chrome_path = which("chromedriver")

driver = webdriver.Chrome(executable_path=chrome_path)
driver.get("http://your_website.com/wp-login.php")
time.sleep(3)

username = driver.find_element_by_id("user_login")
username.send_keys("your_username")

password = driver.find_element_by_id("user_pass")
password.send_keys("your_password")

driver.find_element_by_id("wp-submit").click()

Leave a Reply

Your email address will not be published. Required fields are marked *