alexb 2 Posted May 19, 2017 Report Share Posted May 19, 2017 Hi Everyone, I'm trying to figure out how to code this, since all else is failing or other methods (like scrape attribute of the >> image) are causing a bot crash. I want to accomplish this with wildcard inserted in href, but UBOT doesn't like the coding: if($contains("<a class="backgroundBasic mrs bas pvs phm" href=w"//abc.com/*_p/" aria-label="Next page">>></a>") { then { click(<aria-label="Next page">,"Left Click","No") Is there a simple way to confirm for the string below is present, before clicking on the link?<a class="backgroundBasic mrs bas pvs phm" href=w"//www.trulia.com/for_rent/*_p/" aria-label="Next page">>></a> I'm stuck in scrape because the next button continues on through all the pages being scraped, but at the last page, the link disappears but NEXT (>>) button remains present and the bot won't move on and decrement the list. Thank you! Quote Link to post Share on other sites
HelloInsomnia 1103 Posted May 19, 2017 Report Share Posted May 19, 2017 Try this: if($is blank($scrape attribute(<aria-label="Next page">,"href"))) { then { comment("Last Page") alert("Last Page") } else { comment("Not last page") alert("Not last page") } } Quote Link to post Share on other sites
Code Docta (Nick C.) 638 Posted May 19, 2017 Report Share Posted May 19, 2017 I would use $existsif $exists then Regards,Nick 1 Quote Link to post Share on other sites
HelloInsomnia 1103 Posted May 19, 2017 Report Share Posted May 19, 2017 Nick's right that is better and it removes the Ubot subscription dependency, here try this instead: if($exists(<(aria-label="Next page" AND href=w"*trulia.com*")>)) { then { alert("not last page") } else { alert("last page") } } 1 Quote Link to post Share on other sites
alexb 2 Posted May 20, 2017 Author Report Share Posted May 20, 2017 Brilliant Guys! It works!! Thank you very much and now a peace with beautifully working code. 1 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.