httr

Establish a connection using Kerberos Authentication

旧巷老猫 提交于 2019-12-11 08:39:11
问题 I'm trying to establish a connection using kerberos authentication. I think the question I have does not depend on the type of server (in my case it's a cognos tm1 server) nor the language (in my case R with use of the package httr (or RCurl)) since it's more a general http(s) thing. I do not have much experience using kerberos. According to my understanding there is some negotiation between the client and server following the following steps (here get-requests). The only thin I need to pass

Download csv file from webpage after submitting form from dropdown using rvest package in R

百般思念 提交于 2019-12-11 07:23:11
问题 I am working on a webscraping project to download various csv files from this webpage: https://whalewisdom.com/filer/blue-harbour-group-lp#/tabholdings_tab_link I would like to be able to programmatically choose the various reported quarters on the drop down list, hit submit (note that the URL for the page doesnt change for each different quarter) and then "Download CSV" for each of the quarters. As a disclaimer, I am a novice to rvest and below is my attempt at the solution: I first checked

Translating a curl command to R using httr (specifically '--data-binary @')

∥☆過路亽.° 提交于 2019-12-11 07:18:50
问题 I am trying to transcribe some sound files to text using bing speech-to-text. The following command works in command line (using git bash on Windows 10): curl -v -X POST "https://speech.platform.bing.com/speech/recognition/interactive/ cognitiveservices/v1?language=<LANG>&format=detailed" -H "Transfer-Encoding: chunked" -H "Ocp-Apim-Subscription-Key: <MY KEY>" -H "Content-type: audio/wav; codec=audio/pcm; samplerate=16000" --data-binary @<MY .WAV-FILE> I've tried this, but it doesnt work:

How to retrieve response by using POST in R

て烟熏妆下的殇ゞ 提交于 2019-12-11 06:17:39
问题 If you visit https://www.aucklandcouncil.govt.nz/property-rates-valuations/pages/find-property-rates-valuation.aspx then you will see search box. I want '905/8 Ronayne St' to be input, and '12343197398' to be output. I am using R and tried like this but didn't work.. post <- POST("https://www.aucklandcouncil.govt.nz/_vti_bin/ACWeb/ACservices.svc/GetMatchingPropertyAddresses", body = list('ResultCount' = "10", 'SearchText' = "905/8 Ronayne St", 'RateKeyRequired' = "false")) content(post, "text

Downloading file via HTML form in a frame

纵饮孤独 提交于 2019-12-11 01:44:59
问题 I am struggling with downloading (ideally csv, but I could also deal with html format) data from the Alberta Electric System Operator site (AESO Site). The data are access by completing the form and then clicking the OK radio button. I've worked through trying to access this using both rvest and curl, but have run up against a wall. The issue appears to be that the servlet is housed inside a frame I think this is as close as I've gotten using getForm: url <- "http://ets.aeso.ca/ets_web

Save response from web-scraping as csv file

余生颓废 提交于 2019-12-10 18:59:05
问题 I downloaded a file from a website with rvest . How can I save the response as a csv file? Step 1 : Monkey patch rvest package like in this thread: How to submit login form in Rvest package w/o button argument library(tidyverse) library(rvest) library(R.utils) # monkey path submit_form custom.submit_request <- function (form, submit = NULL) { is_submit <- function(x) { if (!exists("type", x) | is.null(x$type)){ return(F); } tolower(x$type) %in% c("submit", "image", "button") } submits <-

httr and Accept-Encoding: gzip, deflate

天涯浪子 提交于 2019-12-10 15:19:34
问题 I want to do the following call in R: curl "http://www.openml.org/api/v1/task/list/limit/3000?api_key=c1994bdb7ecb3c6f3c8f3b35f4b47f1f" -H "Accept-Encoding: gzip, deflate" The line above returns a gzip compressed string. But when I use the httr R-package it seems that "Accept-Encoding: gzip, deflate" is ignored: library(httr) content = GET(url = "http://www.openml.org/api/v1/task/list/limit/3000?api_key=c1994bdb7ecb3c6f3c8f3b35f4b47f1f", add_headers(`Accept-Encoding` = "gzip, deflate")) 回答1:

reading raw data in R to be saved as .RData file using the dropbox api

巧了我就是萌 提交于 2019-12-10 14:43:07
问题 Having worked out the oauth signature approval system, for dropbox, I wanted to download an .RData file that I had saved there, using the API, and httr 's GET function. The request was sucessfull and comes back with data, but it is in a raw format, and was wondering how do I go about converting it into an RData file again on my local drive. This is what I've done so far:... require(httr) db.file.name <- "test.RData" db.app <- oauth_app("db",key="xxxxx", secret="xxxxxxx") db.sig <- sign_oauth1

Successfully coercing paginated JSON object to R dataframe

余生颓废 提交于 2019-12-10 13:35:55
问题 I am trying to convert JSON pulled from an API into a data frame in R, so that I can use and analyze the data. #Install needed packages require(RJSONIO) require(httr) #request a list of companies currently fundraising using httr r <- GET("https://api.angel.co/1/startups?filter=raising") #convert to text object using httr raise <- content(r, as="text") #convert to list using RJSONIO fromJSON(raise) -> new Once I get this object, new , I am having a really difficult time parsing the list into a

httr GET function running out of space when downloading a large file

放肆的年华 提交于 2019-12-10 13:07:48
问题 i'm trying to download a file that's 1.1 gigabytes with httr but i'm hitting the following error: x <- GET( extract.path ) Error in curlPerform(curl = handle$handle, .opts = curl_opts$values) : cannot allocate more space: 1728053248 bytes my C drive has 400GB free.. in the RCurl package, i see the maxfilesize and maxfilesize.large options when using getCurlOptionsConstants() but i don't understand if/how these might be passed to httr through config or set_config .. or if i need to switch over