title: Extracting URLs from page?
body: <p>I've been tearing my hair out playing with variations on this:</p>
  
  <pre><code>'//*[@id="mw-content-text"]/div[2]/table/tbody/tr/td/div/ul/li/a'
  </code></pre>
  
  <p>as an XPath to get all of the school district urls from this wiki page: <a href="http://en.wikipedia.org/wiki/List_of_school_districts_in_Arkansas" rel="nofollow">http://en.wikipedia.org/wiki/List_of_school_districts_in_Arkansas</a> . What's the correct XPath?</p>
  
  <p>Thanks in advance!</p>
  
  <p>Code snippet:</p>
  
  <pre><code>            print 3.1, tree.xpath('//*[@id="mw-content-text"]/div[2]')
              print 3.2, tree.xpath('//*[@id="mw-content-text"]/div[2]/table')
              print 3.3, tree.xpath('//*[@id="mw-content-text"]/div[2]/table/tbody')
              print 3.4, tree.xpath('//*[@id="mw-content-text"]/div[2]/table/tbody')     
              print 3.5, tree.xpath('//*[@id="mw-content-text"]/div[2]/table/tbody/tr/td/div/ul/li/a/text()')                           
              for row in tree.xpath('//*[@id="mw-content-text"]/div[2]/table/tbody/tr/td/div/ul/li/a/text()'):
                  print row
                  district_urls.append('http://en.wikipedia.org'+row.get('href')) 
  </code></pre>
  
  <p>As a reference:</p>
  
  <pre><code>3.1 [&lt;Element div at 0x1109f7f00&gt;]
  3.2 [&lt;Element table at 0x1109f7f00&gt;]
  3.3 []
  3.4 []
  3.5 []
  </code></pre>