title: Error: htmlParseStartTag: misplaced <head> tag, error parsing attribute name, Unexpected end tag : form
body: <p>I need to get data from the site:<a href="http://www.srh.noaa.gov/data/obhistory/KSPA.html" rel="nofollow">http://www.srh.noaa.gov/data/obhistory/KSPA.html</a></p>
  
  <p>My code runs good in R, but before I scheduled a crontab in server, I run the data in Putty, repeated error generated: "htmlParseStartTag: misplaced  tag, error parsing attribute name, Unexpected end tag : form"</p>
  
  <p>Some of the related posts are php, I'm not familiar with that language, anybody knows how to fix the problem in R language? Thanks.</p>
  
  <p>Here is my R code:</p>
  
  <pre><code>LocIDs &lt;- c("KSPA","KALX","K3A1","KTOI")
  library(XML)   
  
  urls &lt;- paste("http://www.srh.noaa.gov/data/obhistory/",LocIDs,".html", sep="")
  
  data &lt;- lapply(urls, function(x) {
  dat &lt;- tryCatch(readHTMLTable(x,header=F,which=4,stringsAsFactors=F),error=function(e) NULL)
   dat$LocID = substr(x, 40, 43)           # Add a column of LocID(4 characters)
   dat &lt;- dat[-c(1:3),c(1,2,7,8,11,14,17)]
   dat &lt;- head(dat, -3)                    # Delete first &amp; last 3 column of table names
   return(dat)                                                                   
  })                                                                              
  
  #Structure list to data.frame
  library(plyr)
  data3 &lt;- do.call(rbind.fill, data)
  </code></pre>