rcurl

Split and transform a R character string into numerical vector

▼魔方 西西 提交于 2019-12-12 03:18:05
问题 I want to convert the following json and put the values into a data frame. It almost works but as.data.frame() puts everything into one row. require(rjson) require(RCurl) y = getURI(url1) y [1] "[{\"close\":5.45836392962902,\"highest\":5.45837200714172,\"lowest\":5.45836392962902,\"open\":5.45837200714172,\"start_time\":\"2012-01-29T18:29:24-08:00\"},{\"close\":5.45837200714172,\"highest\":5.45837200714172,\"lowest\":5.45834791002201,\"open\":5.45835598753471,\"start_time\":\"2012-01-29T18:28

How do I use R to download LEHD data from the website?

女生的网名这么多〃 提交于 2019-12-12 01:38:03
问题 I would like to know how to download LEHD files from their FTP site. https://lehd.ces.census.gov/data/lodes/LODES7/ I need to download the data for multiple years, for both workplace and resident place locations. The files are named regularly, and the technical documentation can be found here: https://lehd.ces.census.gov/data/lodes/LODES7/LODESTechDoc7.2.pdf S000 references all workforce segments JT00 references all job types So a typical file name is: ca_wac_S000_JT00_2008.csv.gz In the

Rcurl with posting data using xml

大憨熊 提交于 2019-12-11 21:07:27
问题 I am trying to translate following curl command to Rcurl and am having trouble in posting the data using a file using RCURL curl –X POST –d @out2 http://211.211.211.211:27844/ssentsvc -- header 'SOAPAction: "http://google.com"' --header 'Content-Type: text/xml' above command works I am trying the following in RCURL, any ideas on how to incorporate -d option in R curl for posting via a data file(xml file) ?? postForm('http://211.211.211.211:27844/ssentsvc' ,style='HTTPPOST',.opts=list

Post XML form using httr

∥☆過路亽.° 提交于 2019-12-11 20:38:44
问题 I am trying to POST an xml object using httr In my application, I am creating the XML object like this: doc <- htmlTreeParse(conts, useInternalNodes = T) xmlFormula <- xpathSApply(doc, "//*/textarea", xmlValue) x <- xmlParseString(xmlFormula) Then I modify the xml on the fly and now want to post it using httr without saving it to disk and uploading from a file POST(MYURL, body=x) # this won't work Is there a method to make the xml object httr friendly? 来源: https://stackoverflow.com/questions

RCurl, error: couldn't connect to host

梦想与她 提交于 2019-12-11 18:13:33
问题 I use Rstudio server, and the packages RCurl and XML. I tried to scrape a webpage, but after having done it once successfully, I got the error message: Error in curlPerform(curl = curl, .opts = opts, .encoding = .encoding) : couldn't connect to host when trying to get the URL: getURL(my_url, encoding="UTF-8", followLocation = TRUE) Any ideas why this is happening? 回答1: Maybe you should try setting your RCurlOptions: options(RCurlOptions = list(proxy = "my.proxy", proxyport = my.proxyport

sftp with R - sftp not a protocol with RCurl

为君一笑 提交于 2019-12-11 15:32:47
问题 I've read a few posts on sftp with R, but was not able to address the problem that I have. There's a decent change I'm just not searching in the right place, and if that's the case, please point me in the right direction. Here's where I'm at: > library(RCurl) > curlVersion() $age [1] 3 $version [1] "7.43.0" $vesion_num [1] 469760 $host [1] "x86_64-apple-darwin15.0" $features ipv6 ssl libz ntlm asynchdns spnego largefile ntlm_wb 1 4 8 16 128 256 512 32768 $ssl_version [1] "SecureTransport"

RCurl getURL SSL error

吃可爱长大的小学妹 提交于 2019-12-11 11:12:12
问题 Related questions: RCurl errors when fetching ssl endpoint R: Specify SSL version in Rcurl getURL statement I am looking at the following: url = https://www.veilingbiljet.nl/resultaten-ajax.asp?order=datum&direction=D&page=1&field=0&regio=39 Then, getURL(url) gives the following error: error:1411809D:SSL routines:SSL_CHECK_SERVERHELLO_TLSEXT:tls invalid ecpointformat list Adding the followinf curl option, suggested in one of the related questions, getURL(url, ssl.verifypeer = TRUE,sslversion

R: Specify SSL version in Rcurl getURL statement

孤街浪徒 提交于 2019-12-11 03:44:00
问题 Aim I am trying to write a statement to connect to a sharepoint online list to retrieve the data for use in R. Background This is my first time using RCurl/curl/libcurl and I've attempted to read the documentation but it's beyond me and doesn't have any relevant examples. Using a<-getURL("https://example.sharepoint.com/_vti_bin/listdata.svc/Glossary") Resulted in an error Error in function (type, msg, asError = TRUE) : Unknown SSL protocol error in connection to example.sharepoint.com:443 A

Error in curlMultiperform(multihandle): embedded nul in string

主宰稳场 提交于 2019-12-11 03:16:33
问题 I'm trying to download a vector of links, but I get an error message that I don't know what to do with. Code included, hoping someone has a workaround. CODE: library(RCurl) library(XML) url <- "http://www.etfs.bmo.com/bmo-etfs/" url.parsed <- htmlParse(url) links <- xpathSApply(url.parsed, "//table//td/a/@href")[-c(1:3)] links <- paste0("http://www.etfs.bmo.com", links) pages <- getURI(links) ERROR MESSAGE: Error in curlMultiPerform(multiHandle) : embedded nul in string: ' \r\n </nobr>\r\n <

RCurl - submit a form and load a page

老子叫甜甜 提交于 2019-12-11 01:02:44
问题 I'm using the package RCurl to download some prices from a website in Brazil, but in order to load the data I must first choose a city from a form. The website is: "http://www.muffatosupermercados.com.br/Home.aspx" and I want the prices from CURITIBA, id=53. I'm trying to use the solution provided in this post: "How do I use cookies with RCurl?" And this is my code: library("RCurl") library("XML") #Set your browsing links loginurl = "http://www.muffatosupermercados.com.br" dataurl = "http:/