title: Extract 2 arguments from web page
body: <p>I want to extract 2 arguments (<code>title</code> and <code>href</code>) from <code>&lt;a&gt;</code> tag from a wikipedia page.   </p>
  
  <p>I want this output eg (<a href="https://en.wikipedia.org/wiki/Riddley_Walker" rel="nofollow">https://en.wikipedia.org/wiki/Riddley_Walker</a>):  </p>
  
  <pre><code>Canterbury Cathedral  
  /wiki/Canterbury_Cathedral  
  </code></pre>
  
  <p>The code:</p>
  
  <pre><code>import os, re, lxml.html, urllib
  
  def extractplaces(hlink):
      connection = urllib.urlopen(hlink)
      places = {}
  
      dom =  lxml.html.fromstring(connection.read())
  
      for name in dom.xpath('//a/@title'): # select the url in href for all a tags(links)
              print name
  </code></pre>
  
  <p>In this case i only get <code>@title</code>.</p>