AVSuresh
AVSuresh

Reputation: 1582

Error in HTML parsing in R

I am getting following error in extracting webdata from cricinfo

> #Set internet
> Setinternet2=TRUE
> 
> #Loading Libraries
> library(XML)
> library(tm)
> library(RCurl)
> 
> #URL
> URL="http://stats.espncricinfo.com/ci/engine/records/batting/most_runs_career.html?class=1;id=2010;type=year"
> 
> #HTML parsing
> List=htmlParse(URL)
Error in htmlParse(URL) : 
  error in creating parser for http://stats.espncricinfo.com/ci/engine/records/batting/most_runs_career.html?class=1;id=2010;type=year
> 

Any idea how to solve this?

Upvotes: 0

Views: 900

Answers (1)

Richie Cotton
Richie Cotton

Reputation: 121177

Try

page <- getURL(URL)
htmlParse(page)

You may need options in the call to getURL as described in my answer to your other question.

Upvotes: 2

Related Questions