Sfoglia il codice sorgente

modify check_table

chencheng 1 anno fa
parent
commit
31b380b82a
1 ha cambiato i file con 3 aggiunte e 1 eliminazioni
  1. 3 1
      cores/check_table.py

+ 3 - 1
cores/check_table.py

@@ -27,7 +27,7 @@ class Table:
     def get_tr(self):
         # str = self.get_body()
         if len(str.split('<tr>')) > 1:
-            return str.split('<tr>')
+            return str.split('<tr>')[1:-1]
         else:
             return []
 
@@ -75,6 +75,8 @@ class Table:
     def check_html(self):
         self.get_empty()
         html_str = self.get_str()
+        print(self.html_arr)
+        print(self.empty)
         if (self.empty > 4 and self.empty > self.total // 4) or ('项目' in html_str and '每份' in html_str and '营养素参考值' in html_str and np.max([len(a) for a in self.html_arr])<3):
             print('识别效果不佳,改变图片颜色!')
             self.change_green2white()