Control HS if if then else?

Here you can ask anything related to JavaScript as applied to Helium Scraper.
Post Reply
doug
Posts: 22
Joined: Tue Aug 16, 2011 12:44 am

Control HS if if then else?

Post by doug » Fri Aug 19, 2011 10:49 pm

Can you provide an example of how to control HS actions with the execution of JavaScript? I want to test the attributes of a field (or its absence) and return true or false and have HS do alternative HS actions.

webmaster
Site Admin
Posts: 521
Joined: Mon Dec 06, 2010 8:39 am
Contact:

Re: Control HS if if then else?

Post by webmaster » Sat Aug 20, 2011 6:56 pm

Here you go. There is also a while loop sample.

Hope it helped.
Attachments
Statements.hsp
(276.91 KiB) Downloaded 1617 times
Juan Soldi
The Helium Scraper Team

doug
Posts: 22
Joined: Tue Aug 16, 2011 12:44 am

Re: Control HS if if then else?

Post by doug » Sat Aug 20, 2011 11:25 pm

Yes, thanks. I see the trick of negation to simulate "else" (taking caution that "then" doesn't change the condition). Your example also shows that the tag for scripts are truly comments and not function names -there are 2 else's and 2 initialize's.

Post Reply