Hi everyone. I am very new to elixir but finding it amazing. Here is what I am trying to do. I am trying to decode a certain part of a website that contains aviation forecast (Called TAF). In my mix.exs I have added the tesla and poison deps. I am using the steps from this site (Writing your first Elixir package (Part 2) | by Syed Faraaz Ahmad | The Wheel | Medium).
The aviation weather site is (METAR Reader - Your preflight weather companion). FACT is the code for Cape Town. If you inspect the code (I am using google), you will find: section class=βreportβ . That will show you the weather forecase.
What I have done (Working in iex) is:
- response = Tesla.get(βMETAR Reader - Your preflight weather companionβ) All OK so far
- response = response.body. All OK so far
- {:ok, result} = Poison.decode response . This is where I get the following error:
** (MatchError) no match of right hand side value: {:error, {:invalid, β<β, 0}}
The way I see it is that I am trying to decode the entire body and there are many HTML tags which I understand. What I am trying to do as mentioned, is just get that part of the site that shows the forecast.
Kind regards
Dmitri