title: Print url when element is a link in Python-Selenium
body: <p>I'm using Python3 and Selenium. The xpath below points to a link. I would like to print the URL. If I write <code>print(link.text)</code> I get the displayed text portion of the link only.
  For example: <code>link.text</code> in the following link would give me &quot;link text&quot; when I want URL.</p>
  <p>HTML:</p>
  <pre><code>&lt;a href=&quot;url&quot;&gt;link text&lt;/a&gt;
  </code></pre>
  <p>Code trials:</p>
  <pre><code>path = f&quot;/html/body/div/section[5]/div/div/div[1]/div[3]/div[{str(n)}]/div/div[1]/div/div[2]/div[1]/a&quot;
  link = driver.find_element_by_xpath(path)
  print(link.url) 
  </code></pre>