async def _run_spider_hook(self, hook_func):
        """
        Run hook before/after spider start crawling
        :param hook_func: aws function
        :return:
        """
        if callable(hook_func):
            try:
                aws_hook_func = hook_func(weakref.proxy(self))
                if isawaitable(aws_hook_func):
                    await aws_hook_func
            except Exception as e:
                self.logger.error(f'<Hook {hook_func.__name__}: {e}')
async def _run_spider_hook(self, hook_func):
        """
        Run hook before/after spider start crawling
        :param hook_func: aws function
        :return:
        """
        if callable(hook_func):
            try:
                aws_hook_func = hook_func(weakref.proxy(self))
                if isawaitable(aws_hook_func):
                    await aws_hook_func
            except Exception as e:
                self.logger.error(f'<Hook {hook_func.__name__}: {e}')
async def _run_spider_hook ( self , hook_func ) : if callable ( hook_func ) : try : aws_hook_func = hook_func ( weakref . proxy ( self ) ) if isawaitable ( aws_hook_func ) : await aws_hook_func except Exception as e : self . logger . error ( f'<Hook {hook_func.__name__}: {e}' )
Run hook before/after spider start crawling
        :param hook_func: aws function
        :return:
Run hook before / after spider start crawling : param hook_func : aws function : return :