Question about Base (HSQLBD) and the WEB

In this regard, some will tell me, use copy/paste to solve the problem of the following question, but I dare to ask it anyway.

Is it possible from a macro (Basic) which could be associated with a button for example and to extract the source code of a current or displayed Web page in order to copy it into a text field of the database ?

If the answer is yes, I imagine it involves the use of APIs (Uno services). At that time which APIs could be involved in such a procedure? I’m a little confused about that and I need some solutions or a direction to follow on this subject.

Get the HSQLDB out of the database document. You get better performance, more features and high resilience against crashes etc.
Then write a program (a real program in Java, Python, Perl or php, no macro) reading the right data from the right web site and write to the HSQLDB via JDBC. Any office suite makes things more complicated than needed.

Thank you Villeroy and Wanderer!

It seems very clear to me that using Basic with LO does not seem to be the way to go.

Both suggestions are also very interesting. I will opt for writing a program with the use of Python as a language. It seems user-friendly and easy to use. I will have to familiarize myself with Java Database Connectivity.

Thanks again for answering this question.

Apache OpenOffice Community Forum - [Python] Macro to extract and reconnect embedded HSQLDB - (View topic) is a macro to extract your embedded HSQL and connect the existing Base document to the extracted HSQL. You may upgrade to HSQL2 or not.
This will also provide the URL to connect any other tool with that databse.

Thanks Villeroy! I’ll take a look at that and if it can help me I’ll use it.

Yes and no. You can get the html-source of a website, but you may not get “all”.
A lot of pages are gererated by databases or scripts themselves. You have no access to this.

Why do you imagine this? As LibreOffice is no Web-Application there may not be much in Uno. And as long as you don’t need to understand/interpret the result a simple loading of a file should be sufficient.

You may start with an external command like curl or write a simple python-script.
It is possible to call curl via Shell-command - even from BASIC.
.
As Villeroy I would not recommend to do this in Basic or “inside” LibreOffice, if there is no special reason for this approach.

On Curl for example: