how to run python script to display webpage for auto login on one click
Question: I have my python script which I guess is fine. I want to keep the script on
the desktop and upon one click I want the script to run and open a browser(IE
or firefox or chrome) and perform the script i.e. to log-in to a website.

    
    
    import urllib, urllib2, cookielib 
    
    username = 'xyzusername' 
    password = 'xyzpassword' 
    
    cj = cookielib.CookieJar() 
    
    opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cj)) 
    
    login_data = urllib.urlencode({'userid' : username, 'pass' : password}) 
    
    resp = opener.open('http://www.gmail.com') 
    
    resp.read()
    
    print resp
    

How do I run the script? Please help.


Answer: Hmmmm, your script is logging into a web site, but it's not opening a browser.

If you want to open a browser, you might be better off looking at
[Selenium](http://seleniumhq.org/):

  * <http://coreygoldberg.blogspot.com/2009/09/selenium-rc-with-python-in-30-seconds.html>
  * <http://jimmyg.org/blog/2009/getting-started-with-selenium-and-python.html>
  * <http://seleniumhq.org/>

