This code works perfectly on the console but when I implement it in my flask application it says that there's an AttributeError
clean = html.unescape(tweet.text)
final = re.sub(r'\w+:\/{2}[\d\w-]+(\.[\d\w-]+)*(?:(?:\/[^\s/]*))*', '', clean)
I also tried import html inside the for loop
and from html import unescape