File size: 805 Bytes
18aab9e
 
6d6e4bc
 
 
 
 
 
 
 
 
 
 
18aab9e
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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 ))