I can do this manually in either Mac using Safari or Google Chrome, or in raspberry Pi OS using Google Chrome. Why, when I search for this Macro do I see solutions that are hundreds of lines long? I have solved this problem on the Mac using AppleScripts to do the Launch Safari/select the Web Page/ Select All (CmdA) (of the web page), return to OO Calc Select the Cell and Paste all the lines of the web page from that point down. This copy/paste procedure only returns all the text from the web page which is exactly what I want. One would think the Code to copy all the text from a web URL link would be a 10 to 20 line macro, something like:
Code: Select all
Sub getURLdata
rem ----------------------------------------------------------------------
rem define variables
dim document as object
dim dispatcher as object
rem ----------------------------------------------------------------------
rem get access to the document
document = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
rem ----------------------------------------------------------------------
Url = "http:/www.mysite.com/my_web_page.html"
URLtext = StarDesktop.loadComponentFromURL(Url, "_blank", 0, Dummy)
rem ----------------------------------------------------------------------
dim args1(0) as new com.sun.star.beans.PropertyValue
args1(0).Name = "ToPoint"
args1(0).Value = "$A$24"
dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args1())
rem ----------------------------------------------------------------------
dispatcher.executeDispatch(document, ".uno:Paste", "", 0, Array())
rem ----------------------------------------------------------------------
end sub
Any help would be appreciated.