本文整理匯總了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)