yanwii 8 سال پیش
والد
کامیت
5ea90572db
1فایلهای تغییر یافته به همراه2 افزوده شده و 1 حذف شده
  1. 2 1
      xiaoiceapi.py

+ 2 - 1
xiaoiceapi.py

@@ -72,13 +72,14 @@ class xiaoiceApi():
         '''
         times = 1
         while times:
+            times += 1
             response = requests.get("http://weibo.com/aj/message/getbyid?ajwvr=6&uid=5175429989&count=1&_t=0" , headers=self.headers)
             self.savePage(response.text, "./tmp/response.txt")
             soup = BeautifulSoup(response.json()['data']['html'], "lxml")
             text = soup.find("p", class_='page').text
             if text != input_strs or times > 20:
                 break
-            time.sleep(0.5)
+            time.sleep(1)
         return text
             
     def savePage(self, text, file):