import mysql.connector
在命令行里运行python脚本,显示没有mysql.connector
cnx = mysql.connector(user =' ', password=' ',host =' ', database =' ')
cnx.close()
cursor = cnx.cursor()
query=(' '), cursor.execute(query)
for (var1, var1) in cursor:
(iteration)
* var1返回的变量类型是什么?在database里是varchar,返回是int?
--------------分割线----------
cursor.execute(query)
for ele in cursor:
print str(ele[0])
myURL = spider.getURL(str(ele[0]))
res = spider.openurl(myURL)
ele是tuple类型,如第一个ele是(42,),如果取ele[0]值为42