diff --git a/html2text.py b/html2text.py index 6e79b43..59fc1e4 100755 --- a/html2text.py +++ b/html2text.py @@ -517,8 +517,9 @@ def handle_tag(self, tag, attrs, start): if tag == "a" and not self.ignore_links: if start: if ('href' in attrs) and \ - not (self.skip_internal_links and - attrs['href'].startswith('#')): + (attrs['href'] is not None) and \ + not (self.skip_internal_links and + attrs['href'].startswith('#')): self.astack.append(attrs) self.maybe_automatic_link = attrs['href'] else: