May-15-2023, 09:49 AM
Hello,
Does someone know how to find the "</body>" closing bit in an HTML file?
Does someone know how to find the "</body>" closing bit in an HTML file?
from bs4 import BeautifulSoup as bs
soup = bs("file.html")
#How to find </body>?
element = soup.body.previous_sibling
if element is none:
print("Nothing")
else
print("Found :", element )Thank you.
