Hey I'm using a macro to search an internet page using regular expression but the page is taking more or less time to load depending on network quality. When i do a pause of 3 seconds for example sometimes it's too long because the page has loaded after only 1 second and sometimes not enough because it copies the page and start the regular expression search before the page has finished loading.
Is there a command such has wait for the page to finish loading?
Or is there a way to say that if the regular expression is failing finding results wait another second and copy/serach the page again?
2nd solution might be better because i don't need all of the page to load like the ads..
If this is one site you're visiting repeatedly, you might enable automatic Reader View for it.
Probably the simplest approach is to wait for the page to load and then invoke a Get URL for the %SafariURL%, saving that to a variable you then process with your regex.
The Get URL action is independent of whatever is currently in the browser, so it doesn't matter if you have reader view enabled. In my experience this action always returns the entire raw contents of the URL - there's no having to wait for it to finish. I use this action extensively to avoid having to use the browser and so I'm able to process web pages in the background. It's more difficult having to use regex etc on raw HTML but it means I can use my Mac for other stuff while it's processing.
Note that the 'JavaScript in Safari' action represents however you're getting the contents of the webpage to test it for your regex result. You can write in some JavaScript to query the page or replace it entirely with whatever actions you currently use to get your regex. You just need to set the RegexResults variable so you can check it in the following If action