|
@@ -11,6 +11,7 @@ class Table:
|
|
|
self.empty = 0
|
|
|
|
|
|
def get_body(self):
|
|
|
+ print(self.html)
|
|
|
try:
|
|
|
res = self.html.split('<tbody>')[1]
|
|
|
except Exception as r:
|
|
@@ -24,7 +25,7 @@ class Table:
|
|
|
return res
|
|
|
|
|
|
def get_tr(self):
|
|
|
- str = self.get_body()
|
|
|
+ # str = self.get_body()
|
|
|
if len(str.split('<tr>')) > 1:
|
|
|
return str.split('<tr>')
|
|
|
else:
|
|
@@ -75,6 +76,7 @@ class Table:
|
|
|
self.get_empty()
|
|
|
html_str = self.get_str()
|
|
|
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()
|
|
|
return 1
|
|
|
return 0
|