mardi 25 avril 2017

R to change the values in html form and scrape web data

I would like to scrape the historical weather data from this page http://ift.tt/2q40DLc.

I am using the code given in this link Using r to navigate and scrape a webpage with drop down html forms.

However, I am not able to get the data probably due to change in structure of the page. In the code from the above link pgform <-html_form(pgsession)[[3]] was used to change the values of the form. I was not able to find a similar form in my case.

url <- "http://ift.tt/2q40DLc"
pgsession <- html_session(url)
pgsource<-read_html(url)
pgform <-html_form(pgsession)

result in my case

> pgform
[[1]]
<form> 'searchform' (GET http://ift.tt/1GioDhK)
<button submit> '<unnamed>
<input text> 's': 




Aucun commentaire:

Enregistrer un commentaire