DmitriDumas
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 (https://medium.com/the-wheel/writing-your-first-elixir-package-part-2-4bd689a8551a).
The aviation weather site is (https://metarreader.com/FACT). 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(“https://metarreader.com/FACT”) 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
Trending in Questions
Other Trending Topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixirconf-us
- #ai
- #blog-post
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #hex
- #security
- #metaprogramming










Showing Posts 1 to 2- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
kokolegorille
Hello,
You need Floki or similar to parse html.
Poison is for json, and there is now Jason instead.
Happy Elixir learning
DmitriDumas
Thanks you. Will look at Floki