@@ -0,0 +1,911 @@
+#!/usr/bin/python%0D%0A#coding:utf-8%0D%0A%0D%0A'''%0D%0Aeasy to request web url%0D%0Aget(url,parameters)%0D%0Apost(url,parameters)%0D%0Atodo:%0D%0A    getAllUrls%0D%0A    getUrlAt(label1,label2)%0D%0A    getUrlById%0D%0A    getUrlByName%0D%0A'''%0D%0A%0D%0Aimport urllib %0D%0Aimport urllib2 %0D%0A%0D%0Adef get(url, data=%7B%7D): %0D%0A    string = urllib.urlencode(data)%0D%0A    url = url if ('?' in url) else (url+'?%25s'%25string)%0D%0A%0D%0A    response = urllib.urlopen(url)%0D%0A    return response.read()%0D%0A%0D%0Adef post(url, data): %0D%0A    req = urllib2.Request(url) %0D%0A    data = urllib.urlencode(data) %0D%0A    #enable cookie %0D%0A    opener = urllib2.build_opener(urllib2.HTTPCookieProcessor()) %0D%0A    response = opener.open(req, data) %0D%0A    return response.read() %0D%0A   %0D%0Adef main(): %0D%0A    posturl = %22http://www.xiami.com/member/login%22 %0D%0A    data = %7B'email':'xxx', 'password':'xxx', 'autologin':'1', 'submit':'%E7%99%BB %E5%BD%95', 'type':''%7D %0D%0A    print post(posturl, data) %0D%0A   %0D%0Aif __name__ == '__main__': %0D%0A    main()%0D%0A

add web visitor,easy to use get,post method