AffiliateBoy 0 Posted June 15, 2013 Report Share Posted June 15, 2013 Hi, I am scraping a page and I would like to stop when a particular elements appears on the page. May sound strange but as you scroll down the page additional content is automatically loaded on the page... What I was thinking was I would loop until this condition is met. Example: start loop, ...scroll, scroll, scroll, check [condition not met]...scroll, scroll, scroll, check [condition not met]...scroll, scroll, scroll, check [condition not met]...scroll, scroll, scroll, check [condition not met]...scroll, scroll, scroll, check [condition not met]...scroll, scroll, scroll, check [condition not met]...scroll, scroll, scroll, check [CONDITION MET], stop loop. The condition is a text element that basically reads, "end of page". Can you tell me how to add a loop command that will stop when this condition is met? Thanks for your help! Quote Link to post Share on other sites
VaultBoss 310 Posted June 15, 2013 Report Share Posted June 15, 2013 There is a UBS command: wait for element that you can use - it has either "Appear" or "Disappear" in Advanced options. Quote Link to post Share on other sites
AffiliateBoy 0 Posted June 17, 2013 Author Report Share Posted June 17, 2013 Hi VaultBoss, Thanks, but I'm not sure if this command will help. If I enter a wait for element command into a loop and that condition is not met my loop breaks on the first cycle. I need my loop to continue until a condition is met. I could definitely be off with this... If I am, please let me know how adding this command works in the situation outlined above. Thanks! Quote Link to post Share on other sites
blumi40 222 Posted June 17, 2013 Report Share Posted June 17, 2013 if exists and if not exists helps u Quote Link to post Share on other sites
VaultBoss 310 Posted June 17, 2013 Report Share Posted June 17, 2013 You can use a LOOP WHILE command node and place your loop exit condition there... LOOP WHILE($exists(~~~~Element to look for here~~~~)) {} Quote Link to post Share on other sites
colton 13 Posted June 17, 2013 Report Share Posted June 17, 2013 I use loop while (not (exist(inner text or whatever your identifier is) ) ) Quote Link to post Share on other sites
AffiliateBoy 0 Posted June 20, 2013 Author Report Share Posted June 20, 2013 Thanks for your help guys. I really appreciate it. 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.