MATLAB Answers

Use Thingspeak to read data from a password protected website

8 ビュー (過去 30 日間)
Andreas Neul
Andreas Neul 2020 年 3 月 22 日
コメント済み: Vinod 2020 年 3 月 27 日
Hi,
I want to read data from a password protected website to my Thingspeak channel. Can somebody help an provide some sample code which opens a website in a browser, enter login ID and password then get the resulting page content automatically?

  3 件のコメント

Christopher Stapels
Christopher Stapels 2020 年 3 月 22 日
MATLAB does not have a built in web browser, but ThingHTTP may be able to help you. Have a lok at the documentation for the ThingHTTP App.
Also have a look at the webread function.
Andreas Neul
Andreas Neul 2020 年 3 月 23 日
Many thanks, Christopher!
I followed your advice and checked the documentation for the ThingHTTP App. Sorry, then I got lost. Topics mentioned there are still on my learning wishlist...
Let me be more precise with my target. I want to read values to my Thingspeak channel provided by https://my.solytic.com/cm/devices/daypower/?siteId=2 .
If I am already logged in, this works fine, but I would like to automate the login+read process.
Would you have some additional advice for me?
Many thanks in advance
and stay healthy!
Andreas (from Germany)
Vinod
Vinod 2020 年 3 月 27 日
Andreas,
You may be able to use the cookie generated when you log in to the website using a browser and pass it in to thingHTTP. This will keep you logged in to the site, and able to parse the content.
If you are reach out to me directly, I may be able to set up some time to screenshare with you and help you out.
-Vinod

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

回答 (1 件)

Christopher Stapels
Christopher Stapels 2020 年 3 月 26 日
編集済み: Christopher Stapels 2020 年 3 月 26 日
I tried to visit my.solytic and the apge timed out, but that might be because I dont have an account. I went to https://www.solytic.com/ but I didnt find API doc.
You may be able to create a new ThingHTTP and enter the url you gave above with your credentials. Persing the result can sometimes be difficult, so leave the parse string part empty for now. Id start with the GET method, but also try the post since you have to supply credentials. Leave the host blank or use my.solytic.com
If solytic has a documented API, you should be able to read their doc to get it working. If its not an open aPI, ThingHTTP probably wont work for you, Im sorry.

  0 件のコメント

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

製品


リリース

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by