title: Extracting hyperlink from HTML table with rvest
body: <p>I've seen similar questions here and implemented the solutions but still can't seem to figure this one out. Still an R novice, so bear with me: I've managed to to get a table of Barack Obama's speeches from <a href="http://www.americanrhetoric.com/barackobamaspeeches.htm" rel="nofollow noreferrer">this website</a> using rvest:</p>
  
  <pre><code>library(rvest)
  page &lt;- read_html("http://www.americanrhetoric.com/barackobamaspeeches.htm")
  speeches &lt;- page %&gt;%
    html_nodes(xpath = '//*[@id="AutoNumber1"]') %&gt;% 
    html_table(fill=TRUE)
  speeches &lt;- speeches[[1]][,2:4]
  head(speeches)
  </code></pre>
  
  <p>which yields:</p>
  
  <pre><code>            X2                                            X3    X4
  1             &lt;NA&gt;                                          &lt;NA&gt;  &lt;NA&gt;
  2    Delivery Date                  Speech Title/Text/MultiMedia Audio
  3     27 July 2004 Democratic National Convention Keynote Speech   mp3
  4  06 January 2005 Senate Speech on Ohio Electoral Vote Counting   mp3
  5     04 June 2005              Knox College Commencement Speech   mp3
  6 15 December 2005              Senate Speech on the PATRIOT Act   mp3
  </code></pre>
  
  <p>However, I'd like to also extract the hyperlink for each entry in the "Speech" column, which naturally lives in the <code>href</code> attribute. I've researched this pretty thoroughly online, and some people say to also specify the html attribute with <code>html_attr('href')</code>, but if I include that in the above code I get this error: </p>
  
  <p><code>Error in UseMethod("xml_attr") : no applicable method for 'xml_attr' applied to an object of class "list"</code></p>
  
  <p>Another person suggesting tinkering with the actual function with <code>trace</code> but that seems overly involved for something that seems kind of straightforward. Any idea where I'm tripping up?</p>