Page 1 of 1

Value from a web page placed into a cell

Posted: Mon Dec 23, 2024 3:38 am
by RMRavik
Using Calc I have an inventory of precious metals. There is a website that has a running chart of spot prices. There is a box on this site that shows the current price. I would like the contents of that box placed into a cell at the activation of that cell.
At present I hyperlink to the site, copy the box and then paste the info into the cell.
It seems like I could do it with a macro but am not familiar with them.
I think I just answered my question. I'll keep looking.
Thanks for your help

Re: Value from a web page placed into a cell

Posted: Mon Dec 23, 2024 4:24 am
by robleyd
Depending on how the web page is structured, you might be able to use Linking to external data. There is also information in the offline HELP - search external data.

Re: Value from a web page placed into a cell

Posted: Mon Dec 23, 2024 12:30 pm
by Lupp
Users of LibreOffice V 4.2 or higher may also try WEBSERVICE() combined with FILTERXML().

Please note:
I'm not an expert in pulling details from the web, and used the mentioned functions myself only once for a solution years ago.

Re: Value from a web page placed into a cell

Posted: Tue Dec 24, 2024 5:02 pm
by RMRavik
I haven't found a web page that will allow me to use the only number I'm after so I'm still searching. I did find one that allows me to use a range of data with the number I'm after but I can't figure out how to access that particular number. I did set up a link to the site so that I can copy the number and place it for now. I'll figure it out and thanks for your help.

Re: Value from a web page placed into a cell

Posted: Thu Jan 02, 2025 9:51 am
by karimali
You can use the WEBSERVICE and FILTERXML functions in Calc to fetch data from a website if it provides a structured XML or API. However, if the site doesn’t support this, you can automate the process with a macro.

Here is the basic macro guide:

Enable macros in OpenOffice (Tools > Options > Security > Macro Security).
Use a script to fetch data from website (you might need additional tools like Python or JavaScript).
If you’re unfamiliar with macros, manual copying may still be the easiest option.

Re: Value from a web page placed into a cell

Posted: Thu Jan 02, 2025 10:40 am
by robleyd
You can use the WEBSERVICE and FILTERXML functions in Calc
Note that these functions are not available in OpenOffice Calc - they are, however, in LibreOffice.

Re: Value from a web page placed into a cell

Posted: Fri Jan 03, 2025 12:11 am
by RMRavik
I've had to redirect my focus but thanks. I am sure I will be back