Newbies Mdroil Posted December 1, 2012 Newbies Posted December 1, 2012 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
Raybaudi Posted December 1, 2012 Posted December 1, 2012 Which is the last closing tag of a well formatted HTML page ?
comment Posted December 1, 2012 Posted December 1, 2012 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.
Newbies Mdroil Posted December 2, 2012 Author Newbies Posted December 2, 2012 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 ....
comment Posted December 2, 2012 Posted December 2, 2012 Are you sure you have named your web viewer correctly?
Recommended Posts
This topic is 4385 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now