You can resolve your situation as mentioned here:
How to use string.replace() in python 3.x
string.replace(oldvalue, newvalue)
You can use a simple string.replace
to resolve your situation.
In your situation:
yourHtmlContainer = """<body><img alt="Images may be two-dimensional, such as a photograph or screen display, or three-dimensional, such as a statue or hologram. They may be captured by optical devices – such as cameras, mirrors, lenses, telescopes, microscopes, etc. and natural objects and phenomena, such as the human eye or water." height="333" src="https://tvfcommunity-dev-ed--c.documentforce.com/servlet/rtaImage?eid=ka02v000001BOfL&feoid=00N2v00000Rjh9i&refid=0EM2v000002ijZG" width="500"><br>Images may be two-<a href="https://en.wikipedia.org/wiki/Dimensional" target="_blank" title="Dimensional">dimensional</a>, such as a <a href="https://en.wikipedia.org/wiki/Photograph" target="_blank" title="Photograph">photograph</a> or screen display, or three-dimensional, such as a <a href="https://en.wikipedia.org/wiki/Statue" target="_blank" title="Statue">statue</a> or <a href="https://en.wikipedia.org/wiki/Hologram" target="_blank" title="Hologram">hologram</a>. </body>"""
print("Before replace")
print(yourHtmlContainer)
newHtml = yourHtmlContainer.replace("tvfcommunity-dev-ed--c.documentforce.com", "globalcommunity.networks.com")
print("After replace")
print(newHtml)
Output:
Before replace
<body><img alt="Images may be two-dimensional, such as a photograph or screen display, or three-dimensional, such as a statue or hologram. They may be captured by optical devices – such as cameras, mirrors, lenses, telescopes, microscopes, etc. and natural objects and phenomena, such as the human eye or water." height="333" src="https://tvfcommunity-dev-ed--c.documentforce.com/servlet/rtaImage?eid=ka02v000001BOfL&feoid=00N2v00000Rjh9i&refid=0EM2v000002ijZG" width="500"><br>Images may be two-<a href="https://en.wikipedia.org/wiki/Dimensional" target="_blank" title="Dimensional">dimensional</a>, such as a <a href="https://en.wikipedia.org/wiki/Photograph" target="_blank" title="Photograph">photograph</a> or screen display, or three-dimensional, such as a <a href="https://en.wikipedia.org/wiki/Statue" target="_blank" title="Statue">statue</a> or <a href="https://en.wikipedia.org/wiki/Hologram" target="_blank" title="Hologram">hologram</a>. </body>
After replace
<body><img alt="Images may be two-dimensional, such as a photograph or screen display, or three-dimensional, such as a statue or hologram. They may be captured by optical devices – such as cameras, mirrors, lenses, telescopes, microscopes, etc. and natural objects and phenomena, such as the human eye or water." height="333" src="https://globalcommunity.networks.com/servlet/rtaImage?eid=ka02v000001BOfL&feoid=00N2v00000Rjh9i&refid=0EM2v000002ijZG" width="500"><br>Images may be two-<a href="https://en.wikipedia.org/wiki/Dimensional" target="_blank" title="Dimensional">dimensional</a>, such as a <a href="https://en.wikipedia.org/wiki/Photograph" target="_blank" title="Photograph">photograph</a> or screen display, or three-dimensional, such as a <a href="https://en.wikipedia.org/wiki/Statue" target="_blank" title="Statue">statue</a> or <a href="https://en.wikipedia.org/wiki/Hologram" target="_blank" title="Hologram">hologram</a>. </body>
For more help:
https://www.w3schools.com/python/ref_string_replace.asp