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.

Web Scraping

Featured Replies

  • Newbies

I new to this web scraping. This is my first time. I have looked at many examples and I can not see what is wrong. I always get a failure. Can someone please tell me what I am doing wrong. It does not seem to matter what web page I scrape of what tag I am looking for. If I go to "Chrome" I can see the source all ok.

 

I am suspecting it is something external from the code ....

 

 

Set Web Viewer [ Object Name: "source"; URL: "http://www.filemaker.com" ]

#
Loop

Pause/Resume Script [ Duration (seconds): 1 ]
Set Variable [ $html; Value:GetLayoutObjectAttribute("source";"content") ] Set Variable [ $elapsed; Value:Get(CurrentTimeStamp) - $start ]
Exit Loop If [ PatternCount($html; "<head>") or $elapsed >30 ]

End Loop


Set Field [ Stats::H7Place; Length($html) ]

 

If [ PatternCount($html; "<head>") < 1 ]
Show Custom Dialog [ Title: "O'Dear o me"; Message: "******* Happens ..... "; Buttons: “OK”, “Cancel” ]

Else
Show Custom Dialog [ Title: "Looking good"; Message: "Got the data"; Buttons: “OK”, “Cancel” ]

End If 

 

Thanks for you help 

 

Mike

Which is the last closing tag of a well formatted HTML page ?

I don't see the variable $start defined anywhere. If it's empty, then the loop will always exit during the first iteration, i.e. after one second.

 

 

In addition, as Daniele says hints, you should be looking for the existence of "</html>" instead of "<head>". I would also make a distinction between:

PatternCount ( $html ; "</html>" )

and:

$elapsed > 30

The former exits the loop because of success, the latter because of failure. The script should not continue the same in both cases.

  • Author
  • Newbies

It does not seem to matter what tag I am looking for.  Tried various Tags. Same result if I use "</html>" or any other tag. It just loops through for the duration of 30 seconds and then fails. It is if it just does not seem to go out to the web ....

Are you sure you have named your web viewer correctly?

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

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.