fix AttributeError: 'NoneType' object has no attribute 'getroottree' when the result is not html / is empty.