DmitriDumas
Decode a part of a website
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
Most Liked
Popular in Questions
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #advent-of-code
- #elixirconf-us
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #performance








