leboseo 0 Posted August 21, 2015 Report Share Posted August 21, 2015 Hi I am trying to make a if statement, if scrape attribute equals >5 then pause, else continue. I tried doing comparison but so far not working if($comparison($scrape attribute(<id="numberblock_ournumber">,"innertext"),"> Greater than",5)) { then { pause script } else { } } Quote Link to post Share on other sites
deliter 203 Posted August 21, 2015 Report Share Posted August 21, 2015 I think you will need to post your code and the webpage you are using as that code works fine from not reading your code/site you are using,maybe add a wait of a few seconds as that information mightn't be loaded when you try to scrape it load html("<p id=\"numberblock_ournumber\">6</p>")if($comparison($scrape attribute(<id="numberblock_ournumber">,"innertext"),"> Greater than",5)) { then { alert("greater than 5") } else { alert("<= 5") }} Quote Link to post Share on other sites
Code Docta (Nick C.) 638 Posted August 21, 2015 Report Share Posted August 21, 2015 make a function that returns true ... assuming the $scrape attrubute is getting something. U5 sometimes has issues doing complex things in its conditionals. so try the $scrape attrubute in a set command if you have not alrady. Then try in a function. if($scrape item()) { then { pause script } else { }}define $scrape item { return($comparison($scrape attribute(<id="numberblock_ournumber">,"innertext"),"> Greater than",5))}alert($scrape item()) Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.