Revert "don't include links anymore"

This reverts commit fba3f789bb.
This commit is contained in:
OneNewDev 2022-05-28 15:24:19 +02:00
parent 0dc6fd60d5
commit c9f435f0f5

View file

@ -57,6 +57,14 @@ class FileScanner(HTMLParser):
words_with_usage[word].score += score
return sorted(words_with_usage.values(), key=lambda tag: tag.score, reverse=True)
def handle_starttag(self, tag, attrs):
if tag != "a":
return
for attr_name, attr_value in attrs:
if attr_name == "href":
self.texte.append(attr_value)
break
def handle_data(self, data):
self.texte.append(data)