["python","html","beautifulsoup"]
Can I remove script tags with BeautifulSoup?

Can <script> tags and all of their contents be removed from HTML with BeautifulSoup, or do I have to use Regular Expressions or something else?
from bs4 import BeautifulSoup soup = BeautifulSoup('<script>a</script>baba<script>b</script>', 'html.parser') for s in soup.select('script'): s.extract() print(soup) baba