1

I am a begginer in R coding (or in coding in general) and I am trying to load a bunch of prices from a website in Brazil.

http://www.muffatosupermercados.com.br/Home.aspx

When I open the page I am prompted with a form to choose a city, in which I want "CURITIBA".

Opening the Cookies in Chrome I get this:

Name: CidadeSelecionada Content: CidadeId=55298&NomeCidade=CURITIBA&FilialId=53

My code is to get the prices from this link: "http://www.muffatosupermercados.com.br/CategoriaProduto.aspx?Page=1&c=2"

    library(httr)
    a1 <- "http://www.muffatosupermercados.com.br/CategoriaProduto.aspx?Page=1&c=2"
    b2 <- GET(a1,set_cookies(.CidadeSelecionada = c(CidadeId=55298,NomeCidade="CURITIBA",FilialId=53)))
    cookies(b2)

From this the only response I get is the session Id cookie:

$ASP.NET_SessionId [1] "o5wlycpnjbfraislczix1dj4"

and when I try to load the page I only get the page behind the form, which is empty:

    html <- content(b2,"text")
    writeBin(html, "myfile.txt")

Does anyone have an idea on how to solve this? I also tried using RCurl and posting the form data with no luck...

There is a link to another thread of mine trying to do this in a different way: RCurl - submit a form and load a page

Community
  • 1
  • 1

0 Answers0