| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- '''
- Created on 2016年7月28日
- @author: uas
- '''
- from html_parser import kind
- #coding=utf-8
- #coding=utf-8
- '''
- Created on 2016年7月20日
- @author: uas
- '''
- from pymongo.mongo_client import MongoClient
- from util_common import Constant
- import random
- class Parserforparameter(object):
-
- def __init__(self):
- self.cli=MongoClient(Constant.MONGODB_URL)
- self.db=self.cli.spider
-
-
- def craw(self):
-
- result=self.db.component_panel_0720.find()
-
- for index,row in enumerate(result):
-
- d=dict()
- d['url']=result['detail_parameter_url']
- d['kind']=kind
- d['analysisTask']=Constant.TODO
- d['downloadTask']=Constant.TODO
- d['cmp_id']=result['cmp_id']
- d['random']=random.random()
- self.db.panel_parameter_0728.insert_one(d)
- d.clear()
- print(index)
-
- if __name__=='__main__':
-
- parser=Parserforparameter()
- parser.craw()
|