ThingHTTP Example not working

7 ビュー (過去 30 日間)
E VdH
E VdH 2020 年 3 月 26 日
コメント済み: Ryszard Olszewski 2020 年 11 月 1 日
Hey,
I'm really new on this and I really don't know how y'all doing it, but I can't even get the ThingHTTP Example to work.
Whatever I'm trying, I always get the message "Error parsing document, try a different parse string."
I'm creating a new ThingHTTP and it brings me to the page with all the parameters.
From the example, step 1, I copy the "https" bitcoin-link into the URL-field. Method is left at "GET"
Finally, from the example, step 3, I copied the full X-Path into the "Parse String" field and clicked "Save ThingHTTP", which brougth me back to the first page.
I copied the "https://api.thingspeak.com/apps/thinghttp/send_request?api_key=XXXXXXXXXXXXXXXX" into a new browserpage and I'm back at the error message.
So I thougth something was changed on the "bitcoin" site.
Went to "https://www.coinbase.com/price/bitcoin", (I'm using Chrome) and selected the element I wanted, and copied the full X-Path from there.
Again, pasted into the "Parse Field" and saved the ThingHTTP again.
I copied the "https://api.thingspeak.com/apps/thinghttp/send_request?api_key=XXXXXXXXXXXXXXXX" into a new browserpage and yet again........back at the error message.

採用された回答

Vinod
Vinod 2020 年 3 月 26 日
編集済み: Vinod 2020 年 3 月 26 日
It appears Coinbase changed their CSS or page layout, yet again. Try this instead:
In the URL field, enter: https://cointelegraph.com/
In the parse string field, enter: //*[@id="header"]/header/div/div[1]/div/div[2]/ul/li[1]/a/span[2]
Now make the ThingHTTP request from your browser. Does it work?
  1 件のコメント
E VdH
E VdH 2020 年 3 月 26 日
Yep, works like a charm.
Thx

サインインしてコメントする。

その他の回答 (1 件)

Ryszard Olszewski
Ryszard Olszewski 2020 年 6 月 17 日
Hi,
I have the same issue with website Investing.com
When I try get price quote f.ex. from website https://www.investing.com/indices/us-spx-500 I get message:
"Error parsing document, try a different parse string."
Probably something they changed, because everything was working fine for many weeks until now.
When I inspect Xpath I can see that this is the same as previous one, so I don't know what can I do.
Could you help me find any solution?
Many thanks!
  4 件のコメント
Vinod
Vinod 2020 年 9 月 23 日
編集済み: Vinod 2020 年 9 月 23 日
You can always have your MATLAB code have the "weekends" logic and write the price to your channel only on weekdays (and in your timezone, if that matters). Let TimeControl execute the MATLAB code every 5 minutes. At this time, every 5 minutes is the most frequently a TimeControl can schedule a MATLAB code execution.
Ryszard Olszewski
Ryszard Olszewski 2020 年 11 月 1 日
I've noticed that values stored in Channels don't have two decimal points.
For example when value from MATLAB code is "123.00", then in the Channel only "123" is stored. In this way I got values with different, random lenght which is not good for my project. I use "format bank" in MATLAB analyse code.
I've tried some functions which convert string to float or double, but "0.00" is returned. Is there any chance to save to- or read from channel values always with two decimal digits - "1.23"?
Moreover it would be really nice if positive values would be with "+" at the beginning.

サインインしてコメントする。

コミュニティ

その他の回答  ThingSpeak コミュニティ

カテゴリ

Help Center および File ExchangeRead Data from Channel についてさらに検索

タグ

製品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by