Пример #1
0
    def calendarParse(self, response):
        item = calendarItem()
        # print("response['meta']:\t",response.meta)
        item['house_id'] = response.meta['house_id']
        item['response'] = response.body.decode('utf8')
        if len(item['response']) == 17221 and "arg2" in response.meta:
            print("********************")
        if len(item['response']) == 17221:
            headers = {('X-Airbnb-API-Key', 'd306zoyjsyarp7ifhu67rjxn52tv0t20')
                       }
            arg1 = re.search("arg1='([^']+)'", item['response']).group(1)
            # print(arg1)
            _0x23a392 = unsbox(arg1)
            arg2 = 'acw_sc__v2=' + hexXor(_0x23a392) + ";"
            meta = {
                'house_id': response.meta['house_id'],
                'url': response.meta['url'],
                "handle_httpstatus_all": True,
                "arg2": arg2,
                "last_proxy": response.meta['proxy']
            }
            # print("errMeta:",meta,response.meta)
            yield Request(url=response.meta['url'],
                          callback=self.calendarParse,
                          errback=self.calendarErrback,
                          meta=meta,
                          dont_filter=True,
                          headers=headers)

        # with open("/{}.html".format(response.meta['house_id']),"w") as f :
        #     f.write(response.body.decode('utf8'))
        yield item
Пример #2
0
    def calendarParse(self, response):
        item = calendarItem()
        # print('\n',response.request.headers,'\n',response.request.url,'\n',response.request.cookies)
        item['house_id'] = response.meta['house_id']
        item['response'] = response.body.decode('utf8')

        yield item
 def calendarParse(self, response):
     item = calendarItem()
     item['house_id'] = response.meta['house_id']
     item['response'] = response.body.decode('utf8')
     yield item