As simple as I can make it:
I have written a python script to extract embed links from an api. I can easily return a list of embed links similar to this:
[<embed>www.example.com/embed/4657889</embed>, <embed>www.example1.com/embed/789465/</embed>, <embed>www.example2.com/embed/132456/</embed>]
But what I would like to do next is take this returned list and replace every <embed>
with <embed src="
as well as replace every </embed>
with ">
ultimately creating a new list that looks like this:
[<embed src="www.example.com/embed/4567889/>, <embed src="www.example1.com/embed/789456/>, <embed src="www.example.com/embed/123456/>]
But as you can see, the word 'embed' is also in the url itself so I have to make sure not to touch that use of the word. I've tried replace(), trip(), a for loop, all with no luck. Anyone have any ideas of how I could implement this? Thank you ahead of time and hope everyone is staying healthy!