parent
fffe76ee5a
commit
c23a6852e1
@ -1,16 +1,24 @@
|
||||
from GrapData import Spider,SaveToDB
|
||||
|
||||
def main():
|
||||
#抓取所有数据填入数据库
|
||||
def updateDB():
|
||||
spider=Spider()
|
||||
saveDb=SaveToDB()
|
||||
spider.url='https://voice.baidu.com/act/newpneumonia/newpneumonia/'
|
||||
#spider.grapProvince()
|
||||
savedb=SaveToDB()
|
||||
#foreignData=spider.grapForeign()
|
||||
#国内疫情概述
|
||||
#InsideData=spider.grapSummaryChina()
|
||||
#国外疫情汇总
|
||||
proData,cityData=spider.grapProvince()
|
||||
saveDb.InsertIntoProvince(proData)
|
||||
saveDb.InsertToCity(cityData)
|
||||
foreignData = spider.grapForeign()
|
||||
saveDb.InsertForeignCountry(foreignData)
|
||||
InsideData=spider.grapSummaryChina()
|
||||
saveDb.InsertSummaryChina(InsideData)
|
||||
OutsideData=spider.grapSummaryForeign()
|
||||
savedb.InsertSummaryForeign(OutsideData)
|
||||
saveDb.InsertSummaryForeign(OutsideData)
|
||||
|
||||
|
||||
|
||||
def main():
|
||||
updateDB()
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
Binary file not shown.
Binary file not shown.
Loading…
Reference in new issue