Sfoglia il codice sorgente

修复附件空表报错的bug

lsm 2 anni fa
parent
commit
03ad32ad09
1 ha cambiato i file con 3 aggiunte e 2 eliminazioni
  1. 3 2
      BiddingKG/dl/interface/Preprocessing.py

+ 3 - 2
BiddingKG/dl/interface/Preprocessing.py

@@ -1043,8 +1043,9 @@ def tableToText(soup):
             for _tr in _tbody.find_all(recursive=False):
                 len_td = len(_tr.find_all(recursive=False))
                 _td_len_list.append(len_td)
-            if len(list(set(_td_len_list))) >= 8 or max(_td_len_list) > 100:
-                return None
+            if _td_len_list:
+                if len(list(set(_td_len_list))) >= 8 or max(_td_len_list) > 100:
+                    return None
         fixSpan(tbody)
         inner_table = getTable(tbody)
         inner_table = fixTable(inner_table)