08-02-2019 07:27 AM
Hi, So in my project im supposed to retrieve the oil prices and convert it from USD to the local currency,
I have this code but It just won't work and i get errors "Error 1181 occurred at DataSocket Read" and "Error 1 occurred at Scan From String (arg 1)".
I'm totally lost here can someone help?
Solved! Go to Solution.
08-02-2019
03:48 PM
- last edited on
11-06-2024
04:51 PM
by
Content Cleaner
@ham19949 wrote:I have this code ...
(No, that's just a picture that we cannot debug)
Datasocket tools don't support https. Use http get instead. Seems to work just fine with your URLs.
08-03-2019 05:35 AM - edited 08-03-2019 06:20 AM
Apologies I'm new to this, but could you please tell me how to obtain specific data from the page using "HTTP get"? For example I want to only get the price from this page (https://www.investing.com/commodities/crude-oil)..
Thanks for your reply.
Edit: Never mind I got it, Thanks again!
08-03-2019 08:24 AM - edited 08-03-2019 08:28 AM
Unfortunately, this site does not offer an API to get short answers with a tailored URL. Seems like you need to keep parsing the gigantic string as you already did. (and if they ever change the page code in the future, you would need to adjust too).
I am sure the same information is available on other sites that offer a better interface, but I can't help you with that.