I'm trying to replace a string stored in a list with an HTML tag in a file by doing:
links=[<a href="http://hexagon-dashboard-gbc-01/vboard/latest?regs=3281546">http://hexagon-dashboard-gbc-01/vboard/latest?regs=3281546<!--V68NUR--></a>]
str1="""<a href="%s">%s<!--V68NUR--></a>"""%(vboard['V68N']['perf.tl'],vboard['V68N']['perf.tl'])
with open(html_file,'r+') as f:
content = f.read()
f.seek(0)
f.truncate()
f.write(content.replace(links[0],str1))
But I get the following error:
TypeError: replace() argument 1 must be str, not Tag.
What am I missing? Please help me with the modification I have to do.