Skip to content

Commit

Permalink
Beautiful soup read write
Browse files Browse the repository at this point in the history
Read in index.html using beautiful soup, and write out. This automatically fixes some errors like unclosed tags.

```py
from bs4 import BeautifulSoup
html_file = "index.html"
with open(html_file, 'r') as file:
    html_content = file.read()
soup = BeautifulSoup(html_content, 'html.parser')
with open(html_file, 'w', encoding="utf-8") as file:
    file.write(str(soup))
```
  • Loading branch information
VeckoTheGecko committed May 25, 2023
1 parent b2f300d commit b8301be
Showing 1 changed file with 2,626 additions and 2,946 deletions.
Loading

0 comments on commit b8301be

Please sign in to comment.