Extract hint tags from <input placeholder="text">
This is useful for very many input fields, especially prominent on GitHub itself.
This commit is contained in:
parent
58fb41ab9d
commit
cf26201e86
@ -1021,6 +1021,7 @@ class WordHinter:
|
||||
"alt": lambda elem: elem["alt"],
|
||||
"name": lambda elem: elem["name"],
|
||||
"title": lambda elem: elem["title"],
|
||||
"placeholder": lambda elem: elem["placeholder"],
|
||||
"src": lambda elem: elem["src"].split('/')[-1],
|
||||
"href": lambda elem: elem["href"].split('/')[-1],
|
||||
"text": str,
|
||||
@ -1029,7 +1030,7 @@ class WordHinter:
|
||||
extractable_attrs = collections.defaultdict(list, {
|
||||
"img": ["alt", "title", "src"],
|
||||
"a": ["title", "href", "text"],
|
||||
"input": ["name"]
|
||||
"input": ["name", "placeholder"]
|
||||
})
|
||||
|
||||
return (attr_extractors[attr](elem)
|
||||
|
Loading…
Reference in New Issue
Block a user