HTML 태그 유효성을 검사하고 싶습니다. 올바른 HTML인지 아닌지 ... 코드를 시도했습니다.HTML 태그 유효성 확인
def must_have_proper_htmltag(self,filename):
"""
:param filename:
:return:
"""
print(filename)
return bool(BeautifulSoup(filename, 'html.parser').find())
'''Beautiful soup is library function to pull HTML or XML
html.parser is for choosing html doc and find() for
checking occuranc'''
`htmltags='<html><head><title>Test</title></head>''<body><h1>Parse me!</h1>
</body></html>'
nohtmltag = '<html><head><title>Test</title></head>''<body><h1>Parse me!'
print('html checkers:-',qc.must_have_proper_htmltag(htmltag))
print('html checkers:-',qc.must_have_proper_htmltag(nohtmltag))
HTML 태그가 적합한 지 여부를 확인하지
않는 HTML 태그 또는 not..it가 있는지이 기능 검사 여부를 내 문제는 내가 HTML 태그 유효성을 검사 할 수 있습니다 어떻게 출력을 원하는입니다 HTML 태그 하나는 참입니다. 다른 하나는 거짓입니다.