MarkCitrus / RemoveHTMLtags.py
JPLTedCas's picture
Update RemoveHTMLtags.py
18aab9e
raw
history blame contribute delete
805 Bytes
from bs4 import BeautifulSoup #line:2
HTML_DOC ="""
<html>
<head>
<title> Geeksforgeeks </title>
<style>.call {background-color:black;} </style>
<script>getit</script>
</head>
<body>
is a
<div>Computer Science portal.</div>
</body>
</html>
"""#line:17
def remove_tags (O0OOO0OO000O0O00O ):#line:20
OOOO000O000OOOO00 =BeautifulSoup (O0OOO0OO000O0O00O ,"html.parser")#line:23
for OOO00O000O00O0O0O in OOOO000O000OOOO00 (['style','script']):#line:25
OOO00O000O00O0O0O .decompose ()#line:27
return ' '.join (OOOO000O000OOOO00 .stripped_strings )#line:30
print (remove_tags (HTML_DOC ))