From 2b55de38dcd540273fc66df8684ff105e7c74390 Mon Sep 17 00:00:00 2001 From: Marek Siarkowicz Date: Sat, 13 Jun 2015 04:22:17 +0200 Subject: Ignore not anwser responses. --- ParrotZik.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ParrotZik.py b/ParrotZik.py index 638391a..efa8732 100644 --- a/ParrotZik.py +++ b/ParrotZik.py @@ -92,8 +92,10 @@ class ParrotZikApi(object): self.sock.recv(30) else: self.sock.recv(7) - data = self.sock.recv(1024) - data = BeautifulSoup(data) + + data = BeautifulSoup(self.sock.recv(1024)) + if not hasattr(data, 'anwser'): + data = BeautifulSoup(self.sock.recv(1024)) return data def close(self): -- cgit v1.2.1