Read data from website and import them into objects. - Printable Version +- Logic Machine Forum (https://forum.logicmachine.net) +-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1) +--- Forum: Scripting (https://forum.logicmachine.net/forumdisplay.php?fid=8) +--- Thread: Read data from website and import them into objects. (/showthread.php?tid=4386) |
Read data from website and import them into objects. - robikozo - 16.11.2022 Hi, I'm wondering is you can take data from any website like https://www.nordpoolgroup.com/en/Market-data1/Dayahead/Area-Prices/ALL1/Hourly/?dd=LT&view=table and export it into an virtual object. Robert RE: Read data from website and import them into objects. - sx3 - 17.11.2022 Check this script out that Admin helped me out with a couple of days/weeks ago. It fetches the prices from Vattenfall API, maybe it will work for you with your price area? In my Case I live in Sweden, pricearea SN3 (SE3). Easiest practise would be to find a API with JSON output I beleive. Code: require('json') RE: Read data from website and import them into objects. - robikozo - 18.11.2022 Hi, How do you execute this script? RE: Read data from website and import them into objects. - sx3 - 18.11.2022 Vattenfall release tomorrows prices aprox at 15.00 (Swedish time) At midnight at 00.00 I execute a scheduled script that fetches todays prices. And also I have a scheduled script that executes 15.00 and fetch tomorrows prices. 1-24 GA for hourly prices. TODAY 25-27 GA for min/max/median prices. TODAY 28 GA for datestamp for later verification that I have latest fetch. 29-54 GA for hourly prices. TOMORROW 55-57 GA for min/max/median prices. TOMORROW I then send all of theese values to InfluxDB database and also 3rd party visualization server. Attached pictures are a bit old and cointain minor bugs sending to Influx Server.. Bugs are fixed, but it gives you an idea how I represent the values. RE: Read data from website and import them into objects. - tigi - 23.11.2022 Hi Robikozo, Below code will fetch any data from a webpage. All you have to do is look into the source html of the webpage and copy paste the html part you are interested in. Take into account that hard returns have to be defined as /n Replace the part you want to fetch with (.-) Below example fetched the latest Endex 303 prices from the Belgian Engie website Code: -- Scraping a value from a webpage Hope this helps! |