本文整理汇总了Python中ms_spider_fw.DBSerivce.DBService.getTableTitle方法的典型用法代码示例。如果您正苦于以下问题:Python DBService.getTableTitle方法的具体用法?Python DBService.getTableTitle怎么用?Python DBService.getTableTitle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ms_spider_fw.DBSerivce.DBService
的用法示例。
在下文中一共展示了DBService.getTableTitle方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: begin
# 需要导入模块: from ms_spider_fw.DBSerivce import DBService [as 别名]
# 或者: from ms_spider_fw.DBSerivce.DBService import getTableTitle [as 别名]
def begin():
db = DBService(dbName='jddata', tableName='thirdPartShopInfo')
data = db.getData()
title = db.getTableTitle()[1:-2]
S = set()
for item in data:
S.add(tuple(item[1:-2]))
data = []
for item in S:
data.append(list(item))
csv = CSV()
csv.writeCsv(savePath='D:/spider', fileTitle=title, data=data, fileName='jdData')
示例2: dataGen
# 需要导入模块: from ms_spider_fw.DBSerivce import DBService [as 别名]
# 或者: from ms_spider_fw.DBSerivce.DBService import getTableTitle [as 别名]
def dataGen():
comDict = companyInfo()
proDict = productInfo()
dict = {}
for item in comDict.items():
if item[0] in proDict.keys():
dict[item[0]] = comDict[item[0]] + [proDict[item[0]]]
else:
continue
data = [item[1] for item in dict.items()]
db1 = DBService(dbName='jddata', tableName='thirdPartShopInfo')
title = db1.getTableTitle()
title = title + ['commnetCount']
print(title)
db2 = DBService(dbName='jddata', tableName='thirdPartShopInfoAddtest')
db2.createTable(tableTitle=title)
db2.data2DB(data=data)