title: parsing html and following a javascript link
body: <p>I have been asked to extract info by an academic colleague from a website where I need to link the content of a webpage in a table - not too hard with the contents of a text file which is only reacheable (as far as I can tell) by clicking on a javascript link... e.g.</p>
  
  <pre><code>&lt;a id="tk1" href="javascript:__doPostBack('tk1$ContentPlaceHolder1$grid$tk$OpenFileButton','')"&gt;
  </code></pre>
  
  <p>The table is conveniently inside a table with id='tk1' which is nice... but how do I follow the link which pulls the text file.</p>
  
  <p>Ideally I'd like to do this in R... I can grab the relevant table in text format by saying</p>
  
  <pre><code>u &lt;- the url of interest...
  library(XML)
  tables = readHTMLTable(u)
  interestingTable &lt;- tables[grep('tk1', names(tables))]
  </code></pre>
  
  <p>And this will give the text in the table, but how do I grab the html for that particular table? and how do I "click" on the button and get the text file behind it?</p>
  
  <p>I note that there is a form with massive hidden values - the site appears to be asp.net driven and uses impenetrable URLs.</p>
  
  <p>Many thanks!</p>