0

On one machine (windows 7) this code work well:

library(XML)
library(RCurl)
library(xtable)
library(httr)
library(xml2)
theurl <- "https://biz.yahoo.com/c/s.html"
webpage <- content(GET(theurl))
tables <- readHTMLTable(webpage)
splits <- tables[[length(tables)]]
splits

> splits
Payable Ex\nDate               Company Symbol Optionable? Ratio Announced  Add\nTo MyCalendar
1             <NA>                <NA>   <NA>        <NA>  <NA>      <NA>               <NA>
2  May 19   May 20      Alliant Energy    LNT           Y   2-1    Apr 20                Add
3  May 27   May 30 Stock Yards Bancorp   SYBT           N   3-2   May 02*                Add

On windows server 2012 there is error:

tables <- readHTMLTable(webpage)
Error in (function (classes, fdef, mtable)  : 
unable to find an inherited method for function ‘readHTMLTable’ for signature ‘"xml_document"’

What could be the reason? Is there any other posibility to parse this www?

MarekW
  • 41
  • 5

1 Answers1

1

readHTMLTable does not support https. See ?readHTMLTable, under Examples:

## Not run: 
## This changed to using https: in June 2015, and that is unsupported.
# u = "http://en.wikipedia.org/wiki/World_population"
u = "https://en.wikipedia.org/wiki/List_of_countries_and_dependencies_by_population"

For a solution to the same problem, see this answer.

Community
  • 1
  • 1
larkvi
  • 160
  • 8