def execute(self, **kwargs): status = STATUS_CODE[SUCCESS_STATUS] self.execute_message = status['message'] self.execute_status = status['status'] self.state_flag = 'WaitLogin' message = generate_log_data(self, extend_log_func) logger.info(message)
def execute(self, **kwargs): self.state_flag = '' status = STATUS_CODE['no_supported_crawler']['status'] message = STATUS_CODE['no_supported_crawler']['message'] save_status(self.sid, status, message) message = generate_log_data(self, extend_log_func) logger.info(message)
def execute(self, **kwargs): key, level, message = self.crawler.verify(**self.parameters) if level == 0: status_code = STATUS_CODE[SUCCESS_STATUS] self.state_flag = 'UnderCrawl' elif level == 2: status_code = STATUS_CODE[key] self.state_flag = 'WaitCode' else: status_code = STATUS_CODE[key] self.state_flag = 'Failed' self.execute_status = status_code['status'] self.execute_message = message message = generate_log_data(self, extend_log_func) logger.info(message)
def execute(self, **kwargs): user_info = {} call_log = [] parse_call_log = True for retry_time in xrange(CRAWL_RETRY_TIMES): key, level, message, user_info = \ self.crawler.crawl_info(**self.parameters) if level == 0 and user_info['full_name']: break time.sleep(3) else: status_code = STATUS_CODE[key] save_data(self.sid, tel=self.tel, user_info=user_info, call_log=call_log, status=status_code['status'], message=message) parse_call_log = False if parse_call_log: for retry_time in xrange(CRAWL_RETRY_TIMES): key, level, message, call_log = \ self.crawler.crawl_call_log(**self.parameters) if level == 0: status_code = STATUS_CODE[SUCCESS_STATUS] break else: status_code = STATUS_CODE[key] time.sleep(3) save_data(self.sid, tel=self.tel, user_info=user_info, call_log=call_log, status=status_code['status'], message=message) if level == 0: success_data(self.sid) self.execute_status = status_code['status'] self.execute_message = message self.state_flag = 'End' message = generate_log_data(self, extend_log_func) logger.info(message)
def execute(self, **kwargs): if self.now_verify_request == 'SMS': key, level, message, image_str = \ self.crawler.send_sms_request(**self.parameters) elif self.now_verify_request == 'Captcha': key, level, message, image_str = \ self.crawler.send_captcha_request(**self.parameters) if level == 0: status_code = STATUS_CODE[SUCCESS_STATUS] self.sent_verify_request.append(self.now_verify_request) self.state_flag = 'WaitCode' else: status_code = STATUS_CODE[key] self.state_flag = 'Failed' self.verify_content = image_str self.execute_status = status_code['status'] self.execute_message = message message = generate_log_data(self, extend_log_func) logger.info(message)
def execute(self, **kwargs): targets = [self.next_step] for verify_type in self.need_verify_request: send_target = 'Get{}'.format(verify_type) targets.append(send_target) parameter_status, parameter_timeout, action, parameters = \ get_parameter(sid=self.sid, targets=targets) status_code, state_flag = after_get_parameter(parameter_status, parameter_timeout, action) if not state_flag: self.parameters.update(parameters) if action == self.next_step: self.state_flag = 'UnderLogin' else: self.now_verify_request = action.remove('Get') self.state_flag = 'UnderLoginVerifyRequest' else: self.state_flag = state_flag self.execute_status = status_code['status'] self.execute_message = status_code['message'] message = generate_log_data(self, extend_log_func) logger.info(message)
def execute(self, **kwargs): key, level, message = self.crawler.login(**self.parameters) self.verify_type = \ self.crawler.get_verify_type(**self.parameters) if level == 0: status_code = STATUS_CODE[SUCCESS_STATUS] if self.data_sid: self.state_flag = 'NoCrawl' elif not self.verify_type: self.state_flag = 'UnderCrawl' else: self.state_flag = 'WaitCode' elif level in [1, 2]: status_code = STATUS_CODE[key] self.state_flag = 'WaitLogin' else: status_code = STATUS_CODE[key] self.state_flag = 'Failed' self.execute_status = status_code['status'] self.execute_message = message message = generate_log_data(self, extend_log_func) logger.info(message)
def execute(self, **kwargs): self.state_flag = '' message = generate_log_data(self, extend_log_func) logger.info(message)
def execute(self, **kwargs): self.state_flag = '' save_status(self.sid, self.pre_status, self.pre_message) message = generate_log_data(self, extend_log_func) logger.info(message)