How to pull a page into R

Avatar image for lb3ptman
LB3PTMAN

9

Forum Posts

0

Wiki Points

0

Followers

Reviews: 0

User Lists: 0

Hi, I am a bit rusty in R and was wondering if I could have some assistance. I am trying to iterate through all the game pages and pull some information. I know how to get the URLs and how to handle the data once I get it into R, I just was having issues pulling the webpage into R as a JSON or XML file. Some help would be greatly appreciated.

Avatar image for xpsync
xpsync

18

Forum Posts

0

Wiki Points

0

Followers

Reviews: 0

User Lists: 0

@lb3ptman:

Not sure if this is helpful to you or not

https://www.dezyre.com/data-science-in-r-programming-tutorial/r-tutorial-importing-data-from-web

Avatar image for lb3ptman
LB3PTMAN

9

Forum Posts

0

Wiki Points

0

Followers

Reviews: 0

User Lists: 0

I attempted to use xmlToDataFrame to parse https://www.giantbomb.com/api/game/3030-76126/?api_key=[YOUR_KEY]&field_list=name,original_release_date

with my key in of course

and all I got was this error message

> result <- xmlToDataFrame(url)

Error: XML content does not seem to be XML: 'ld_list=name,original_release_date'

Avatar image for xpsync
xpsync

18

Forum Posts

0

Wiki Points

0

Followers

Reviews: 0

User Lists: 0

you try getURL then parse

Avatar image for xpsync
xpsync

18

Forum Posts

0

Wiki Points

0

Followers

Reviews: 0

User Lists: 0

library is RCurl i think, been some time :)

Avatar image for lb3ptman
LB3PTMAN

9

Forum Posts

0

Wiki Points

0

Followers

Reviews: 0

User Lists: 0

Attempted to use GetURL and got this Error Message :/

> page <- getURL(url)

Error in function (type, msg, asError = TRUE) :

error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version

Avatar image for xpsync
xpsync

18

Forum Posts

0

Wiki Points

0

Followers

Reviews: 0

User Lists: 0

if i'm following correctly, try removing get from geturl

url = "https://whatever.com"

json = fromJSON((url))

or try

ssl.verifypeer = FALSE

Avatar image for lb3ptman
LB3PTMAN

9

Forum Posts

0

Wiki Points

0

Followers

Reviews: 0

User Lists: 0

Ok got it in. Thank you. Should be able to turn it into a data frame from here!

Avatar image for xpsync
xpsync

18

Forum Posts

0

Wiki Points

0

Followers

Reviews: 0

User Lists: 0

Aweseom! and Welcome!