Пример #1
0
 def project(self, response):
     tr = templates.jilin_json_url_analysis(response, 2, state=True)
     for every_tr in tr:
         yield scrapy.Request(
             url=every_tr,
             callback=self.project_basic,
             meta={'companyName': response.meta['companyName']})
Пример #2
0
 def project_construction_list(self, response):
     tr = templates.jilin_json_url_analysis(response, 6)
     for every_tr in tr:
         yield scrapy.Request(url=every_tr,
                              callback=self.construction_info,
                              meta={
                                  'companyName':
                                  response.meta['companyName'],
                                  'code': response.meta['code']
                              })
Пример #3
0
 def project_construction_list(self, response):
     tr = templates.jilin_json_url_analysis(
         response, 6, big='http://218.60.144.163/LNJGPublisher')
     for every_tr in tr:
         yield scrapy.Request(url=every_tr,
                              callback=self.construction_info,
                              meta={
                                  'companyName':
                                  response.meta['companyName'],
                                  'name': response.meta['name']
                              })
Пример #4
0
    def project_drawing_list(self, response):
        tr = templates.jilin_json_url_analysis(response, 0, direct=True)
        for every_tr in tr:
            td = every_tr.xpath('./td')
            if td[1].xpath('text()'):
                censorNum = td[1].xpath('text()')[0]
            else:
                censorNum = ''

            if td[2].xpath('text()'):
                surveyCorpName = td[2].xpath('text()')[0]
            else:
                surveyCorpName = ''

            if td[3].xpath('text()'):
                designCorpName = td[3].xpath('text()')[0]
            else:
                designCorpName = ''

            if td[4].xpath('text()'):
                censorCorpName = td[4].xpath('text()')[0]
            else:
                censorCorpName = ''

            if td[5].xpath('text()'):
                censorEDate = td[5].xpath('text()')[0]
            else:
                censorEDate = ''
            drawing = templates.MakeDrawing(
                companyName=response.meta['companyName'],
                code=response.meta['code'],
                censorNum=censorNum,
                surveyCorpName=surveyCorpName,
                provinceCensorNum=censorNum,
                designCorpName=designCorpName,
                censorCorpName=censorCorpName,
                censorEDate=censorEDate)
            drawing_data = drawing.data()
            print(drawing_data, '施工图纸审查')
            yield scrapy.Request(
                url=
                'https://api.maotouin.com/rest/companyInfo/addCompanyProjectCensor.htm',
                body=json.dumps(drawing_data),
                callback=self.project_zz,
                headers={'Content-Type': 'application/json'},
                method='POST',
                meta={'type': '施工图纸审查'})