3 Replies Latest reply on Nov 18, 2011 9:14 AM by beverly

    Retrive data from web based page

    gchampion

      I would like to be able to pull data from a web page and dump it back in a filemake db.

       

      We have gotten to the point to that we can get to the page but can't search the web site for the information we want to retrive.
      The nest step would be to put the retrived information into filemaker.

       

      Any help would be appreciated.

       

      Thanks in advance.

       

      G.

        • 1. Re: Retrive data from web based page
          RayCologon

          Hi,

           

          If you place a web viewer onto a FileMaker layout, give it an object name and define it to point at the URL in question, after it loads in Browse mode, you'll be able to get the html source of the loaded page as text, using a calculation along the lines of:

           

          GetLayoutObjectAttribute("WebViewerObjectName" ; "content")

           

          ...where WebViewerObjectName is the name you assigned to the web viewer object via the Inspector in Layout mode.

           

          Once you have the html content, you can either locate and extract out the data you need (ie parsing it out using FileMaker's built-in text functions), or pluck out the hyperlinks one at a time to walk the site (eg in a looping script) looking for other data of interest - or both.

           

          Hopefully that gives you a place to start.

           

          Regards,

          Ray

          ------------------------------------------------

          R J Cologon, Ph.D.

          FileMaker Certified Developer

          Author, FileMaker Pro 10 Bible

          NightWing Enterprises, Melbourne, Australia

          http://www.nightwingenterprises.com

          ------------------------------------------------

          • 2. Re: Retrive data from web based page
            LyndsayHowarth

            Hi G,

             

            You might also find that a custom PHP page can search the site and extract the data to then add to FileMaker.

             

            Depending on your server, this might be with or without the PHP API for FIleMaker.... If you don't have Server Advanced, you could use standard PHP to construct a page of the extracted info then deploy Ray's suggestion to script the addition of the info to FileMaker.

             

            - Lyndsay

            • 3. Re: Retrive data from web based page
              beverly

              Just a *caution*. "scraping" a web page (as it's called) can be:

              1. difficult to parse

              2. changed at any time on the web site and thus invalidate any and all parsing routines

              3. be illegal unless you have permission of the website owner/hosting provider.

               

              If you have permission, then perhaps you can get a "feed" which is already provided by the website/hosting provider. This can be a .csv, for example, that you can just download and import.

               

              Yes, I've done scraping. Yes, I've provided feeds. YMMV (your mileage may vary)