-
Notifications
You must be signed in to change notification settings - Fork 0
/
wordpress.py
29 lines (20 loc) · 901 Bytes
/
wordpress.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# Script AutoLogin Wifi ID oleh Azis R. Pratama
# Modifikasi dari script autologin gmail oleh Hongkiat
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
usernameStr = 'pratama'
passwordStr = 'rahasia'
browser = webdriver.Chrome()
browser.get(('http://127.0.0.1/wp-login.php?redirect_to=http%3A%2F%2F127.0.0.1%2Fwp-admin%2F&reauth=1'))
# isikan username voucher wifi ID Anda
username = browser.find_element_by_id('user_login')
username.send_keys(usernameStr)
# memberikan sedikit jeda 1 detik
password = WebDriverWait(browser, 1).until(
EC.presence_of_element_located((By.ID, "user_pass")))
password.send_keys(passwordStr)
signInButton = browser.find_element_by_id('wp-submit')
signInButton.click()
# Todo List: