diff --git a/witchie/utils/__init__.py b/witchie/utils/__init__.py index 80e9817..0544321 100644 --- a/witchie/utils/__init__.py +++ b/witchie/utils/__init__.py @@ -61,10 +61,10 @@ def get_text(element, links, images): return f'{element.text}' for a in element.find_all('a'): soup = BeautifulSoup("", "html.parser") - if (element['href'] != element.text - and 'mention' not in element.get('class', []) - and 'tag' not in element.get('rel', [])): - links.append(a.href) + if (a['href'] != element.text + and 'mention' not in a.get('class', []) + and 'tag' not in a.get('rel', [])): + links.append(a['href']) new_tag = soup.new_tag('a') new_tag.string = '<cyan>' + a.text + '</cyan>' a.replace_with(new_tag)