title: 'list' object has no attribute 'get_attribute' while iterating through WebElements
body: <p>I'm trying to use Python and Selenium to scrape multiple links on a web page. I'm using <code>find_elements_by_xpath</code> and I'm able to locate a list of elements but I'm having trouble changing the list that is returned to the actual <code>href</code> links. I know <code>find_element_by_xpath</code> works, but that only works for one element.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>path_to_chromedriver = 'path to chromedriver location'
  browser = webdriver.Chrome(executable_path = path_to_chromedriver)
  
  browser.get("file:///path to html file")
  
  all_trails = []
  
  #finds all elements with the class 'text-truncate trail-name' then 
  #retrieve the a element
  #this seems to be just giving us the element location but not the 
  #actual location
  
  find_href = browser.find_elements_by_xpath('//div[@class="text truncate trail-name"]/a[1]')
  all_trails.append(find_href)
  
  print all_trails
  </code></pre>
  
  <p>This code is returning:</p>
  
  <pre><code>&lt;selenium.webdriver.remote.webelement.WebElement 
  (session="dd178d79c66b747696c5d3750ea8cb17", 
  element="0.5700549730549636-1663")&gt;, 
  &lt;selenium.webdriver.remote.webelement.WebElement 
  (session="dd178d79c66b747696c5d3750ea8cb17", 
  element="0.5700549730549636-1664")&gt;,
  </code></pre>
  
  <p>I expect the <code>all_trails</code> array to be a list of links like: <code>www.google.com, www.yahoo.com, www.bing.com</code>.</p>
  
  <p>I've tried looping through the <code>all_trails</code> list and running the <code>get_attribute('href')</code> method on the list but I get the error:</p>
  
  <p><a href="https://i.stack.imgur.com/8geip.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/8geip.png" alt="Picture of error"></a></p>
  
  <p>Does anyone have any idea how to convert the selenium WebElement's to href links?</p>
  
  <p>Any help would be greatly appreciated :)</p>