title: How to use R to download a file from webpage when there is no specific file embedded on the page
body: <p>Is there any possible solution to extract the file from any website when there is no specific file uploaded using download.file() in R. </p>
  
  <p>I have this url </p>
  
  <pre><code>https://www.fangraphs.com/leaders.aspx?pos=all&amp;stats=bat&amp;lg=all&amp;qual=y&amp;type=8&amp;season=2016&amp;month=0&amp;season1=2016&amp;ind=0
  </code></pre>
  
  <p>there is a link to export csv file to my working directory, but when i right click on the export data hyperlink on the webpage and select the link address 
  it turns to be the following script </p>
  
  <pre><code>javascript:__doPostBack('LeaderBoard1$cmdCSV','') 
  </code></pre>
  
  <p>instead of the url which give me access to the csv file. </p>
  
  <p>Is there any solution to tackle this problem.</p>