Jump to content
UBot Underground

If Contains This Exact String With Wildcard Url, Then Click On Link


Recommended Posts

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!

Link to post
Share on other sites

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")
    }
}
Link to post
Share on other sites

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")
    }
}
  • Like 1
Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...