When I try to insert the following HTML into an element
<div class="frontpageclass"><h3 id="feature_title">The Title</h3>... </div>
bs4 is replacing it like this:
<div class="frontpageclass"><h3 id="feature_title">The Title </h3>... <div></div>
I am using string and it is still messing up the format.
with open(html_frontpage) as fp:
soup = BeautifulSoup(fp,"html.parser")
found_data = soup.find(class_= 'front-page__feature-image')
found_data.string = databasedata
If I try to use found_data.string.replace_with I get a NoneType error. found_data is of type tag.