import MySQLdb
import time
try:
conn=MySQLdb.connect(host='localhost',user='root',passwd='',db='abin',port=3306)
cur=conn.cursor()
result=cur.execute('select * from tabin')
print result
print '-------'
info=cur.fetchmany(result)
for ii in info:
currentTime = time.strftime('%Y-%m-%d %H:%M:%S',time.localtime(time.time()))
values=[ii[1],currentTime]
cur.execute('insert into sabin (name,create_time) values (%s,%s)',values)
print '===='
cur.close()
conn.commit()
conn.close()
except MySQLdb.Error,e:
print "Mysql Error %d: %s % ()e.args[0],e.args[1]"
import urllib
params = urllib.urlencode({'type':'mobile','parameter':'13521502037','pageNum':1,'pageSize':10})
conn = urllib.urlopen("http://test.qunar.com:7400/complaints/find.action",params);
result = conn.read()
print result