I’d like to scrape a website but for some reason, HTTPoison gives me an empty body.
iex> HTTPoison.get(“Origo”)
{:ok,
%HTTPoison.Response{
body: “”,
headers: [
{“Content-length”, “0”},
{“Location”, “Origo”}
],
request: %HTTPoison.Request{
body: “”,
headers: ,
method: :get,
options: ,
params: %{},
url: “Origo”
},
request_url: “Origo”,
status_code: 301
}}
I tried it with HTTPotion too, the same result:
%HTTPotion.Response{
body: “”,
headers: %HTTPotion.Headers{
hdrs: %{
“content-length” => “0”,
“location” => “Origo”
}
},
status_code: 301
}
I checked the site, it is definitely not empty. I tried to fetch it with Nodejs and it works with that.
As far as I understand both of these clients use Hackney and there is an issue about this on the HTTPoisonGithub. But this issue is closed, so I guess this problem shouldn’t exist anymore?
Does anyone have any idea what should I do here?






















