About Me

My photo
I am Raghuram Reddy, Adobe Certified Senior ColdFusion Developer (8yrs of exp.) working in Dubai, UAE. Contact me at: raghuramgreddy@gmail.com

Friday, June 18, 2010

Application in python to open browser and login gmail

#!/usr/bin/env python
# This application opens firefox browser and keeps you login : raghuramgreddy@gmail.com
# Note: Before running this application please provide username,password credentials : raghuramgreddy@gmail.com
import SendKeys
import time
import os
import subprocess

FFPATH = os.environ["PROGRAMFILES"] + '\mozilla firefox/firefox.exe'
url = "http://gmail.com"
subprocess.Popen([FFPATH,url])
time.sleep(3)
username = """ grramreddy """
SendKeys.SendKeys(username)
time.sleep(2)
SendKeys.SendKeys('{TAB}')
password = """password """
SendKeys.SendKeys(password)
time.sleep(2)
SendKeys.SendKeys('{TAB 2}')
time.sleep(2)
SendKeys.SendKeys('{ENTER}')
time.sleep(5)
SendKeys.SendKeys('%{SPACE}n')

Comming Soon.......Python::pyWinAuto control applications

No comments:

Post a Comment