original_docstring: Extract tag words form the given element.
docstring: Extract tag words form the given element.
docstring_tokens: Extract tag words form the given element .
code: def extract_tag_words(
              self, elem: webelem.AbstractWebElement
      ) -> Iterator[str]:
          """Extract tag words form the given element."""
          _extractor_type = Callable[[webelem.AbstractWebElement], str]
          attr_extractors: Mapping[str, _extractor_type] = {
              "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,
          }
  
          extractable_attrs = collections.defaultdict(list, {
              "img": ["alt", "title", "src"],
              "a": ["title", "href", "text"],
              "input": ["name", "placeholder"],
              "textarea": ["name", "placeholder"],
              "button": ["text"]
          })
  
          return (attr_extractors[attr](elem)
                  for attr in extractable_attrs[elem.tag_name()]
                  if attr in elem or attr == "text")
code_tokens: def extract_tag_words ( self , elem : webelem . AbstractWebElement ) -> Iterator [ str ] : _extractor_type = Callable [ [ webelem . AbstractWebElement ] , str ] attr_extractors : Mapping [ str , _extractor_type ] = { "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 , } extractable_attrs = collections . defaultdict ( list , { "img" : [ "alt" , "title" , "src" ] , "a" : [ "title" , "href" , "text" ] , "input" : [ "name" , "placeholder" ] , "textarea" : [ "name" , "placeholder" ] , "button" : [ "text" ] } ) return ( attr_extractors [ attr ] ( elem ) for attr in extractable_attrs [ elem . tag_name ( ) ] if attr in elem or attr == "text" )
short_docstring: Extract tag words form the given element.
short_docstring_tokens: Extract tag words form the given element .
comment: """Extract tag words form the given element."""