I am trying to extract a URL from a text file which contains a source code of a website. I want to get the website link inside href and I wrote some code I borrowed from stackoverflow but I can't get it to work.
with open(sourcecode.txt) as f:
urls = f.readlines()
urls = ([s.strip('\n') for s in urls ])
print(url)