When I try to use e.string to modify HTML in BS4, I get HTML entities. For example:
Code:
for i in soup.find_all('ism'):
i.string = currentSpan
# currentSpan is a string of HTML text and does not have entities
Result
<span>Keep going until you see </span><ism type="cr"><span style="color: gold; background: blue; border-style: double; padding-left: 5px; padding-right: 5px;">County Road 9</span></ism>
(ism is a custom tag name I am using).
Is there a function I can use to add tags and override entity conversion?