Here's what you have to with Selenium to get started.
- Install Selenium using pip by
pip install selenium
in the command prompt.
- Make sure you have the python path in your environment variables.
- Run this script by changing the email and the password below.
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import time
browser = webdriver.Firefox()
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<mpl=default<mplcache=2&emr=1&osid=1#identifier')
email = browser.find_element_by_xpath('//*[@id="Email"]')
email.clear()
email.send_keys("email@gmail.com") # change email
email.send_keys(Keys.RETURN)
password = browser.find_element_by_xpath('//*[@id="Passwd"]')
password.clear()
password.send_keys("password") # Change Password
password.send_keys(Keys.RETURN)
time.sleep(10)
browser.save_screenshot('screen_shot.png')
browser.close()
- And finally you can run
schtask
on the saved python file from the command prompt.
schtask
is the CRON
equivalent on windows.
schtasks /Create /SC MINUTE /MO 120 /TN screenshot /TR "PATH_TO_PYTHON_FILE\FILE.py"