title: Web Scrape Non Farm Payrolls dates in R
body: <p>I would like to web scrape past dates for Non Farm Payrolls from here  <a href="http://www.bls.gov/bls/archived_sched.htm" rel="nofollow">http://www.bls.gov/bls/archived_sched.htm</a> (archive) and here <a href="http://www.bls.gov/schedule/news_release/empsit.htm" rel="nofollow">http://www.bls.gov/schedule/news_release/empsit.htm</a> (current year).</p>
  
  <p>Something similar was achieved by Peter Chan for FOMC dates here: <a href="https://github.com/returnandrisk/r-code/blob/master/FOMC%20Dates%20-%20Scraping%20Data%20From%20Web%20Pages.R" rel="nofollow">https://github.com/returnandrisk/r-code/blob/master/FOMC%20Dates%20-%20Scraping%20Data%20From%20Web%20Pages.R</a>. This is his code:</p>
  
  <pre><code>install.packages(c("httr", "XML"), repos = "http://cran.us.r-project.org")
  
  library(httr)
  library(XML)
  
  # get and parse web page content                                            
  webpage &lt;- content(GET("http://www.federalreserve.gov/monetarypolicy/fomccalendars.htm"), as="text")
  xhtmldoc &lt;- htmlParse(webpage)
  # get statement urls and sort them
  statements &lt;- xpathSApply(xhtmldoc, "//td[@class='statement2']/a", xmlGetAttr, "href")
  statements &lt;- sort(statements)
  # get dates from statement urls
  fomcdates &lt;- sapply(statements, function(x) substr(x, 28, 35))
  fomcdates &lt;- as.Date(fomcdates, format="%Y%m%d")
  # save results in working directory
  save(list = c("statements", "fomcdates"), file = "fomcdates.RData")
  </code></pre>
  
  <p>I would like to replicate that for NFP. Just as fomcdates contains all FOMC dates, I would like to create NFPdates containing all NFP dates. </p>
  
  <p>Would anyone know how to do so for the current year only? (asking current year as it seems to be the simplest). Thank you.</p>