diff --git a/qutebrowser/browser/hints.py b/qutebrowser/browser/hints.py index 2a1716bcf..143946309 100644 --- a/qutebrowser/browser/hints.py +++ b/qutebrowser/browser/hints.py @@ -1094,7 +1094,7 @@ class WordHinter: }) return (attr_extractors[attr](elem) - for attr in extractable_attrs[elem.tagName()] + for attr in extractable_attrs[elem.tag_name()] if attr in elem or attr == "text") def tag_words_to_hints(self, words): diff --git a/qutebrowser/browser/webkit/webelem.py b/qutebrowser/browser/webkit/webelem.py index 5fd21397a..41e321821 100644 --- a/qutebrowser/browser/webkit/webelem.py +++ b/qutebrowser/browser/webkit/webelem.py @@ -327,6 +327,11 @@ class WebElementWrapper(collections.abc.MutableMapping): self._check_vanished() return utils.compact_text(self._elem.toOuterXml(), 500) + def tag_name(self): + """Get the tag name for the current element.""" + self._check_vanished() + return self._elem.tagName() + def rect_on_view(self, *, elem_geometry=None, adjust_zoom=True, no_js=False): """Get the geometry of the element relative to the webview.