Sto provando a raschiare dati da un sito Web protetto da password in R. Leggendo intorno, sembra che i pacchetti httr e RCurl siano le migliori opzioni per raschiare con l'autenticazione tramite password (Ho anche esaminato il pacchetto XML).Scrape sito Web protetto da password in R
Il sito che sto cercando di raschiare è al di sotto (è necessario un account gratuito per poter accedere alla pagina intera): http://subscribers.footballguys.com/myfbg/myviewprojections.php?projector=2
Qui sono i miei due tentativi (sostituendo "username" con il mio nome utente e la " password" con la password):
#This returns "Status: 200" without the data from the page:
library(httr)
GET("http://subscribers.footballguys.com/myfbg/myviewprojections.php?projector=2", authenticate("username", "password"))
#This returns the non-password protected preview (i.e., not the full page):
library(XML)
library(RCurl)
readHTMLTable(getURL("http://subscribers.footballguys.com/myfbg/myviewprojections.php?projector=2", userpwd = "username:password"))
ho guardato in altri posti rilevanti (link sotto), ma non riesco a capire come applicare le loro risposte al mio caso.
How to use R to download a zipped file from a SSL page that requires cookies
How to webscrape secured pages in R (https links) (using readHTMLTable from XML package)?
Reading information from a password protected site
R - RCurl scrape data from a password-protected site
http://www.inside-r.org/questions/how-scrape-data-password-protected-https-website-using-r-hold
Questo funziona per me. Ho modificato con l'output di contenuto – jdharrison
Cool! Non penso che sia molto più facile ... – Stefan
Ho testato entrambe le risposte e funzionano entrambe alla grande.Ho selezionato questo per la sua semplicità. – dadrivr