Yasu777 commited on
Commit
e6d81c6
·
verified ·
1 Parent(s): 64e4113

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -0
app.py CHANGED
@@ -6,6 +6,12 @@ from tinydb import TinyDB, Query
6
  import datetime
7
  from bs4 import BeautifulSoup
8
 
 
 
 
 
 
 
9
  # データベースの初期化
10
  db = TinyDB("db.json")
11
  current_time = datetime.datetime.now()
 
6
  import datetime
7
  from bs4 import BeautifulSoup
8
 
9
+ def is_valid_html(html):
10
+ with warnings.catch_warnings(record=True) as w:
11
+ warnings.simplefilter('always')
12
+ BeautifulSoup(html, 'html.parser')
13
+ return len(w) == 0
14
+
15
  # データベースの初期化
16
  db = TinyDB("db.json")
17
  current_time = datetime.datetime.now()