made by G.M
需要安装 [selenium](http://script.farbox.com/post/selenium_install"selenium安装方法 ") 模块
测试环境windows7+python2.7

#!/usr/bin/python
# -*- coding: gb2312 -*-
from selenium import webdriver
import time
def lingdou(username,password):
    dev=webdriver.Firefox()
    dev.get('http://home.51cto.com/index.php?s=/Index/index/reback/http%253A%252F%252Fdown.51cto.com')
    word=dev.find_element_by_name('email')
    word.send_keys(username)
    word=dev.find_element_by_name('passwd')
    word.send_keys(password)
    word=dev.find_element_by_name('button')
    word.click()
    time.sleep(2)
    word=dev.find_element_by_id('ld')
    word.click()
    print "今天的豆已经领完"
if __name__ == "__main__":
    try:
        username="yourusername"    ####用户名
        password="yourpasswd"   ###密码
        lingdou(username,password)
    except:
        print "今天已经领过豆了。"