title: How to get the value of a attribute of an element in xpath
body: <p>I'm tring to get the color and the image of this code:</p>
  <pre><code> &lt;a href=&quot;javascript:void(0)&quot; class=&quot;logsss_event_cl itemAttr current &quot; title=&quot;MULTI&quot; data- 
   value=&quot;MULTI&quot; data-logsss-const-value=&quot;{'x': 'change_color'}&quot;&gt;&lt;img 
   src=&quot;https://gloimg.rglcdn.com/rosegal/pdm-product-pic/Clothing/2020/12/24thumb- 
   img/1608776712993433956.jpg?im_scale=h34_1x&quot;&gt;&lt;/a&gt;
  
   &lt;a href=&quot;javascript:void(0)&quot; class=&quot;logsss_event_cl itemAttr  &quot; title=&quot;LIGHT PINK&quot; data-value=&quot;LIGHT 
   PINK&quot; data-logsss-const-value=&quot;{'x': 'change_color'}&quot;&gt;&lt;img 
   src=&quot;https://gloimg.rglcdn.com/rosegal/pdm-product-pic/Clothing/2021/04/08thumb- 
   img/1617901013166741553.jpg?im_scale=h34_1x&quot;&gt;&lt;/a&gt;
  </code></pre>
  <p>Both of these look the same except in the class one ends in current.</p>
  <p>My problem is I do not know how to get just the value of an element.</p>
  <p>I've tried:</p>
  <pre><code> color1a= driver.find_element_by_xpath('//*[@id=&quot;select-attr-0&quot;]/a[1]').text
  
   color1a= driver.find_element_by_xpath(&quot;//*[@class='logsss_event_cl itemAttr 
   current']&quot;).get_Attribute(&quot;data-value&quot;).text
  
   tumb1= driver.find_element_by_xpath('//*[@id=&quot;select-attr-0&quot;]/a[2]/img').text
  </code></pre>