Untitled

 avatar
unknown
python
2 years ago
1.0 kB
8
Indexable
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.by import By
import time

opt = webdriver.ChromeOptions()
opt.add_argument("user-agent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.5112.102 Safari/537.36 [ip:5.91.172.254]")
browser = webdriver.Chrome(options=opt)
browser.implicitly_wait(30)

browser.get('https://accounts.google.com/ServiceLogin?service=mail&passive=true&rm=false&continue=https://mail.google.com/mail/&ss=1&scc=1&ltmpl=default&ltmplcache=2&emr=1&osid=1#identifier')

email = browser.find_element(By.XPATH, '//*[@id="passp-field-login"]')
email.clear()
email.send_keys("mail")  # change email
email.send_keys(Keys.RETURN)

password = browser.find_element(By.XPATH, '//*[@id="passp-field-passwd"]')
password.clear()
password.send_keys("pwd")  # Change Password
password.send_keys(Keys.RETURN)

time.sleep(10)

browser.save_screenshot('screen_shot.png')
browser.close()
Editor is loading...