Created
January 9, 2023 08:03
-
-
Save cyb3rsalih/f09f26c7dec847b45153e40826177877 to your computer and use it in GitHub Desktop.
Remove HTML elements from a file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
mext = '' | |
with open('html.txt', 'r') as f: | |
text = f.read() | |
mext = re.sub('<[^<]+?>', '', text) | |
with open('without_html.txt', 'w') as x: | |
x.write(mext) | |
# Thanks ChatGPT Assistant |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment