Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Issues With Scraping A Web Page

Featured Replies

I am using FM 10 on a windows system.

I am having an issue with dealing with "real" web page code in a web viewer after the user clicks on a link. This is the process

1) User presses scripted button to load web page from www.somesite.com/page1.htm into viewer

2) Layout changes and script processes web page and reloads it into same viewer using only local variables

3) User clicks on a link that is contained within the processed (from step 2) web page.

4) Web page loads into viewer from www.somesite.com/page2.html

5) User clicks different FM scripted button to process page (same script as step 2)

6) The variable that contains GetLayoutObjectAttribute("viewer";"content") for processing the newly load page only returns the contents of the html code that the viewer had at the end of step 2 instead of the new page that was loaded in step 4.

I have tried refreshing the page, moving to a different record and then back without any success, and using GOTO OBJECT (viewer) to try to capture the new page code without success.

If I right click on the web viewer, and choose VIEW SOURCE CODE, I see the HTML code for the current page, however I just cant get FM to grab that code.

I am hoping that someone might have some thoughts on the matter.

Thank you for your attention.

You are experiencing a bug in FileMaker for Windows.

The "content" returned by GetLayoutObjectAttribute doesn't properly update after the web viewer changes content.

This bug has been reported to and confirmed by FileMaker staff.

http://forums.filemaker.com/posts/0cfe7b8c21

  • Author

I have found a somewhat clunky way around this issue. I right click on a link that leads to the desired web page within the web viewer and SAVE SHORTCUT or I can hold CTRL & ALT and drag the link (or paste) into a global field that has a scripted button. Then reloads the web viewer based on the value of the global field.

Has anyone perhaps come up with a less clunky solution?

Thanks for your attention.

I've recently been experimenting with attaching to the COM object corresponding to the WebViewer, since under Winblows, it's just an embedded Internet Explorer browser.

Using the free scripting program autoit, Autoit you can attach to the WebViewer.

You can write a script along the lines of the attached file, that will retrieve the HTML in the current WebViewer, and save it to a file. You can then import it back as a workaround to this bug. FMPro then executes the autoit script.

A more interesting and useful application of this technique is to allow interaction with the WebViewer. i.e. Filemaker can dynamically generate and execute an autoit script to click buttons, complete forms, etc, in the WebViewer. An example of this is also in the attached file.

You can easily have autoit select all, and copy the text in a WebViewer to clipboard. It can insert a JavaScript into the head of a document after it has loaded. Once you have the handle on the COM object, _ieaction can be used to print the webviewer via FM Script which triggers autoit script.

autoit can back call FM Scripts from ActiveX to handle returning, or use its simple TcpRecv example, as a template to trigger an FM Script over the internet, and achieve in a few lines of code, the equivalent to commercial plugins. It's an interesting alternative to VBScripts with some more functionality and GUI capabilities.

I have found a somewhat clunky way around this issue. I right click on a link that leads to the desired web page within the web viewer and SAVE SHORTCUT or I can hold CTRL & ALT and drag the link (or paste) into a global field that has a scripted button. Then reloads the web viewer based on the value of the global field.

Has anyone perhaps come up with a less clunky solution?

Thanks for your attention.

Test222.zip

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.