# How do I enter data into a web page?

I have a Base table with first and last names. For each row, I need to open a URL, enter the names in their respective fields on the page and trigger a Search button. At a minimum I need to send text to the screen. If possible, I would like to load the HTML fields directly and trigger the Search button. (I'll tackle the content extraction of the result later!) Thanks, David

edit retag close merge delete

Sort by » oldest newest most voted

There are different ways to get (and receive) data from the web in LO, but unless you have a specific link to a particular page you most likely will have to use a macro for the process. This seem to be the case for what is asked in your question. Here are a couple of different methods.

Most sites which require further information just pass that information along with the original URL. Case in point - http://www.thefreedictionary.com. Going to this site, you enter a word/phrase in the text box, and then enter to get the results. But if you enter the URL - http://www.thefreedictionary.com/"Hello" to begin with, it immediately returns the definition for 'hello'. To do this in a macro:

sString = "Hello"
Shell "firefox http://www.thefreedictionary.com/" & sString


This uses the Shell command to display the specific URL result in Firefox. Nothing else needed.

Another method is to transmit and receive back information to be further processed. This can be done with WEBSERVICE using FILTERXML. For results on this (calc display) see this post - click here.

This is also possible to accomplish in a macro making it available in Base. The problem here is that it became broken somewhere after LO v5.2.0.4 and still hasn't been fixed or touched as of today. When working this may be exactly what you need. See this post - click here.

There is one more process I have run across. Get the required returned page in the browser (as in first mentioned process) and then scan the page information for what you need to process. See this post - click here.

more

Using the Shell code above in a macro resulted in a "BASIC runtime error. File not found" error. I am using Version: 5.2.7.2 on a Mac with Sierra with Firefox application loaded. Thanks.

( 2017-05-22 11:27:58 +0100 )edit

You get that error when the program cannot be found. Either the name is misspelled or it is not in your Path statement. As I am not familiar with Mac, this post may help - click here. I have had no problem with this or similar statements on Linux Mint or even if I change to 'google-chrome'.

( 2017-05-22 15:51:24 +0100 )edit