LordPorker 7 Posted June 9, 2016 Report Share Posted June 9, 2016 So I need to check the presence of some text on a page. What's the best way to do this? What I've done is: set a variable (error_message) & scrape attribute (it picks up the error message ok). Do I use the IF command after I set up the variable? I tried inputting the var into IF, but nothing happens. Is this the best way to check the presence of some text? Thanks. Quote Link to post Share on other sites
pash 504 Posted June 9, 2016 Report Share Posted June 9, 2016 alert($contains($document text,"some text")) alert($contains($scrape attribute(<tagname="body">,"innertext"),"some text")) Quote Link to post Share on other sites
LordPorker 7 Posted June 9, 2016 Author Report Share Posted June 9, 2016 Thanks Pash. I mean in the context of an IF statement; if message exist then exit, or if message doesn't exist then continue. Quote Link to post Share on other sites
Brutal 164 Posted June 9, 2016 Report Share Posted June 9, 2016 one way is.... set- $document text if contains (your text) then do something else do some other thing Quote Link to post Share on other sites
abbas786 78 Posted June 9, 2016 Report Share Posted June 9, 2016 Try this if($exists(<innertext="We've done everything we can to make UBot Studio as easy to learn as possible">)) { then { } else { } } OR if($contains($document text,"We\'ve done everything we can to make UBot Studio as easy to learn as possible")) { then { } else { } } 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.